jimp-dev / jimp

An image processing library written entirely in JavaScript for Node, with zero external or native dependencies.
http://jimp-dev.github.io/jimp/
MIT License
13.76k stars 761 forks source link

Bad quality (JPEG Compression) when saving PNG #121

Closed super-ienien closed 12 hours ago

super-ienien commented 8 years ago

Hi,

I'm having some trouble with image quality on JIMP. I just download some JPEGs and save them as PNGs :

Jimp.readAsync(url) .then(function (image) { return image.writeAsync("image.png") }

The quality of the PNG is bad comparing to the original JPEG. It's like I was saving it twice in JPEG. See the exemple here (you can see that additionnal JPEG artefacts are presents around the white letters in the PNG):

ORIGINAL JPEG cgajreywqaewbai

SAVED PNG image 1__media_cgajreywqaewbai

oliver-moran commented 8 years ago

These aren't methods from this library:

Jimp.readAsync(url) ... image.writeAsync ...

How are you calling them?

super-ienien commented 8 years ago

Sorry, i'm using promisification functionnality of bluebird. So readAsync ad writeAsync are the promisified version of read and write method from Jimp.

oliver-moran commented 8 years ago

I'm doing a release in a few days. That will have some fixes in it, could you check again then?

super-ienien commented 8 years ago

I don't have time to test it again but i think it's due to the pngjs package more than Jimp

oliver-moran commented 8 years ago

Yes, definitely to do with pngjs. I'll keep an eye on it and if there's improvement to that library I'll pull it in. Thanks for logging it.

oliver-moran commented 8 years ago

Tested again after updating pngjs. Issues still presents.

oliver-moran commented 8 years ago

Suspect same as this issue: https://github.com/oliver-moran/jimp/issues/134

hipstersmoothie commented 6 years ago

still an issue

hipstersmoothie commented 6 years ago

https://github.com/eugeneware/jpeg-js/issues/17

hipstersmoothie commented 12 hours ago

If you want more accurate image codecs please use the WASM ones. The exact issue here is probably an issue with one of the default JS based codecs.