how can i save pixel changes in image?
2 views (last 30 days)
i made pixel value changes in an image , then i save it in a new name, then i wanted to use the new in another code, i checked the pixel values and
232 240 253
10 240 253
182 194 208
why is that?? shouldn't be the pixelvalue=10 240 253??
David Young on 8 Jun 2015
Could be because JPEG compression loses information, so a write followed by a read only returns an approximation to the original. Try using a lossless format, such as BMP, instead of JPEG.
Also, do you need to write the image out to a file and read it back anyway? It's usually much more efficient simply to pass the image between functions or scripts in memory, using the name of the variable that refers to it.