Pixels are messed up when converting PNG to JPG

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
dunghnguyen
Posts: 2
Joined: 2017-01-02T19:39:33-07:00
Authentication code: 1151

Pixels are messed up when converting PNG to JPG

Post by dunghnguyen »

Hi ImageMagick,

I had a file whose pixels were messed up when converting PNG to JPG.
I tried with the latest version, but there's same issue.
Please help me investigate it.

Sample: https://www.dropbox.com/s/8pta1bcl9vts6 ... s.zip?dl=0

Thanks,
Dung H. Nguyen
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Pixels are messed up when converting PNG to JPG

Post by GeeMack »

dunghnguyen wrote:I had a file whose pixels were messed up when converting PNG to JPG.
I tried with the latest version, but there's same issue.
Please help me investigate it.

Sample: https://www.dropbox.com/s/8pta1bcl9vts6 ... s.zip?dl=0
Please always provide the version of ImageMagick you're using and let us know which platform or OS you're running it on.

At the most basic, your sample looks like you just need to flatten the image onto the background during the conversion. Try this...

Code: Select all

convert sample_input.png -flatten sample_flattened.jpg
Or to select a particular background color other than white in this case, you can try something like this...

Code: Select all

convert sample_input.png -background purple -flatten sample_purple_background.jpg
dunghnguyen
Posts: 2
Joined: 2017-01-02T19:39:33-07:00
Authentication code: 1151

Re: Pixels are messed up when converting PNG to JPG

Post by dunghnguyen »

Hi,

Thanks for quick response.

I tested with both version 7.0.1 and 7.0.4 on Windows 8.1 x64

I've just checked "-flatten", it's OK with this sample. However, I need to test more image files before confirming that there's no other issues.

Thanks,
Dung H. Nguyen
Post Reply