Comments (5)
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.
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.
many thanks
from scintillating_heatshrink.
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.
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)
- Convert gif to array HOT 20
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scintillating_heatshrink.