###JPG_Quality_Loss

N.Vischer 23-May-2018

ImageJ macro for testing the JPG quality loss for spatial measurements.  
We detect the minima along radial profiles in an image with concentric rings   
that are spaced at 15 pixels.

- A TIF image (Circles.tif) containig concentric rings with varying intensites is created,  
- A copy (Circles.jpg) is saved as JPG and reloaded  
- In both images (TIF and JPG), and the distances between the
minima along radial profiles are measured and compared.

- Measurements are performed on copies that are scaled-up by factor 10 
(*after* JPG conversion) to get a resolution of 0.1 pixels.  

- Output: A table with two columns (intervalsTIF and intervalsJPG) is shown. In theroy, all values should be 15 pixels. The screenshot shows values for JPG quality=75% (which is adjustable)

- Note that saving and reloading a JPG image a second time at same quality setting does not change the image contents.



---
#####Try it:
Run the macro 


<https://sils.fnwi.uva.nl/bcb/objectj/examples/utils/JPG_Quality_Loss/JPG_Quality_Loss.txt>


![](JPG_Loss.png)







	Test 1:
	=======
	JPG Quality:  90
	Image size (K):  156.2
	JPG File size (K):  26.5
	Max Contrast Flag:  1
	Nominal Interval = 15 pixels

	intervalsTIF: StdDev = 0.1427 pixels
	intervalsJPG: StdDev = 0.2061 pixels

	Range TIF: = 14.6 - 15.5 pixels
	Range JPG: = 14.5 - 15.8 pixels

	Test 2:
	=======
	JPG Quality:  75
	Image size (K):  156.2
	JPG File size (K):  10.0
	Max Contrast Flag:  0
	Nominal Interval = 15 pixels

	intervalsTIF: StdDev = 0.1453 pixels
	intervalsJPG: StdDev = 0.3781 pixels

	Range TIF: = 14.6 - 15.5 pixels
	Range JPG: = 14.2 - 15.9 pixels


