jimp-dev/jimp
View on GitHubCan Jimp write a jpg file which exactly have the same color which I set?
Open
#685 opened on Dec 31, 2018
bughelp wanted
Description
Expected Behavior
I used setPixelColor to operate the color of each pixels.
I used this to save the jpg file:
picture.quality(100).writeAsync(path);
I wish that Jimp can write a jpg file which exactly have the same color which I set.
Current Behavior
When I used getPixelColor to read the saved jpg, I found that the colors are a little bit different with what I operated.
But this seems only effected with saving jpg.
After I saved the picture as bmp, I read the bmp file. I got the colors I wanted.
Steps to Reproduce
- Use Jimp.read to read the jpg file.
- Use setPixelColor to edit a color of a pixel.
- Use quality(100).writeAsync to save the file as a new jpg.
- Use Jimp.read to read the new jpg file.
- Use getPixelColor to get the color which I edited.
- Compare the color with what I set before.
- They are different a little.
Context
- Jimp Version: 0.6.0
- Operating System: Windows 10 Pro 64bit
- Node version: 111.6.0
So, may I save the color into jpg strictly as what I want?
Thank you for checking this.
Failure Logs
Nope.