I set pixel from one jpg. Save it another jpg file. Read a new file again. Get pixel. But it gives me incorrect result. That\'s my code:
use Image::Magick;
use
Posting an answer to correspond to my comment above.
This would be best explained by a comparison of lossy vs lossless compression:
https://en.wikipedia.org/wiki/Lossy_compression
In short, you can work with an array of RGB pixels with imagemagick, set pixel values, get them, etc.
When you save, there are additional operations that are out of your control. In the case of JPEG, it is a lossy compression algorithm known as DCT (discrete cosine transformation): http://en.wikipedia.org/wiki/Discrete_cosine_transform. This lossy compression (in the case of JPEG) is necessary in order to reduce the file size.
If you do not want to encounter this issue, you either need to work with: