New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read and write some gifs wrong, with "artifacts". "optimize" doesn't work #2543
Comments
There's definitely something odd with these images in the palette Also, as an aside, optimize trims the palette size if there are unused items and the palette can be reduced to the next lower power of 2. There's a max of ~760 bytes per palette that could be saved (if there's a pathologically bad encoding of a b/w image). It's not going to do much of anything for these images. |
I have very similar problem (probably the same), it degrades the quality of the images, it adds noise. See for example: |
The noise is likely dither, which is used to make palette images more perceptually correct in color at the expense of noise. Pillow's quantize doesn't have a very sophisticated method of determining if dither is needed, it's either on or off depending on the parameter passed in to edit -- that's |
Thanks for responding, that's what I needed, thank you! |
I've created PR #5857 to fix the original problem here, resolving this. |
What did you do?
I read each frame of the gif, and then write them to a file.
What did you expect to happen?
That everything will work without a headache =)
What actually happened?
Some gif files wrote with artifacts and "optimize" doesn't work
pic2.gif
pic6.gif
I think compare successful and unsuccessful gifs will be right. Therefore I downloaded the gifs archive
"Bad" and "good" gifs tar archive
What versions of Pillow and Python are you using?
Pillow-4.1.1-cp35-cp35m-manylinux1_x86_64.whl
Python 3.5.2
Ubuntu 16.04.2 amd64
The text was updated successfully, but these errors were encountered: