How can I convert a png file using terminal or maybe a Python script to a jpg without artifacts; here's what I did and image was malformed: cat.png: enter image description here

jalal@klein:~$ convert cat.png cat.jpg

jalal@klein:~$ eog cat.jpg 

enter image description here

jalal@klein:~$ convert cat.png -quality 95 cat_95.jpg
jalal@klein:~$ eog cat_95.jpg 

enter image description here

share|improve this question
    
Not helpful to your question (and I'm glad someone found a solution to the problem!), but I'll just note that the problem you've discovered could be a cool basis for glitch art. – r_alex_hall Nov 11 '17 at 13:44
up vote 2 down vote accepted

It looks like you are suffering from issues due to the alpha channel in your PNG.
You can remove this and replace with a background of you choice using the following command:

convert cat.png -background white -alpha remove cat.jpg
share|improve this answer
    
wow!! Smart! so much thanks! imgur.com/a/E7hmk – Mona Jalal Oct 18 '16 at 18:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.