GithubHelp home page GithubHelp logo

Comments (5)

sutaburosu avatar sutaburosu commented on July 2, 2024 1

I've deleted the VM now, but I was definitely using Python 3. apt install python3-pil pulled in a compatible version of PIL 9.x.x.

from scintillating_heatshrink.

sutaburosu avatar sutaburosu commented on July 2, 2024

Thanks for the report. I've just tried to convert a GIF on my system, and I received the same error. I guess things have changed in Python 3.10.12 compared to whatever version I was using 3 years ago . I'll try to find time to look at this later today.

from scintillating_heatshrink.

pmerlin avatar pmerlin commented on July 2, 2024

many thanks

from scintillating_heatshrink.

sutaburosu avatar sutaburosu commented on July 2, 2024

Argh! This is turning into a nightmare for a Python newbie like me, who hasn't really touched Python in the last 3 years. My code was written using the PIL library which is now deprecated. Modern Ubuntu uses the Pillow library, which is meant to be compatible.

The root of the problem is that PIL used to return the palette index for each pixel in each frame. Pillow does the same for the first frame of animation, but then every subsequent frame it returns RGB triplets instead. I can't find a way to get the palette indices for frames 1+ out of Pillow. I guess this change was made as a bug fix because animated GIFs can actually store more than 256 colours.

This is going to require significant changes to gif2h.py, so don't hold your breath for a fix.

I just created an Ubuntu 20.04 virtual machine. The code still works correctly in that. You could do that, or email me your GIFs I'll convert them for you. mailto:[email protected]

from scintillating_heatshrink.

pmerlin avatar pmerlin commented on July 2, 2024

I think I'll do the same.
On Ubuntu 20, is it working with Python2 or 3 ?
Which version of PIL is successfull ?

this command can show PIL version
import PIL
PIL.version

from scintillating_heatshrink.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.