java - What is the effect of storing a larger value in a grayscale png image? -
i trying perform dct on image block size 8x8 in java. after performing dct on first block, first value "372". after performing dct on entire image, wrote values png-grayscale image.values inside image automatically changed. grayscale image not store value greater 255. happen value greater 255 (for eg., 372) ?
you can not original image after loss of information need to:
- perform dct or ever
- find
min,max
values whole image - change range
pixel(x,y)=(255*(pixel(x,y)-min))/(max-min)
+/-1
or if clamp right range
after lose absolute values relative changes stays there
- for purposes enough
- if need restore original image
- then need encode min,max values
png
somewhere - so add dummy scanline(s) , encode
min,max
first few pixels ...
restoration easy:
- read
png
image - decode min,max
- restore original dynamic range
pixel(x,y)=min+(((max-min)*pixel(x,y))/255)
+/-1
or if clamp right range
- perform idct or ever
Comments
Post a Comment