Comments (4)
This issue is not quite related to this library...
However, I did found this issue: python-pillow/Pillow#4941
Hope this helps! If not, please share the tgs so I can take a look.
from rlottie-python.
Oh, you seems right!
But my thought is to make this library produce better quality GIFs, so it's somehow related? Please allow me to edit the issue descriptions.
Anyway, thanks for your attention! If you think current procedure is fine, then... it's fine! Not a big problem after all.
from rlottie-python.
I see, but if I want the library to produce high quality GIF with Image.LIBIMAGEQUANT
, then I have to somehow include custom compiled Pillow
with support for libimagequant
as dependency in this project, which I think is a feature creep. I think this job should be left to users, as there is many ways to quantize a image (e.g. number of colors, method), each with pros and cons (e.g. File size, image quality), and there is no single best method. Users should decide how their image be quantized based on their use case.
If users want to create gif with Image.LIBIMAGEQUANT
, they can just easily (?):
from rlottie_python import LottieAnimation
from PIL import Image
anim = LottieAnimation.from_file('example/sample.json')
totalframe = anim.lottie_animation_get_totalframe()
frame_duration = 1000 / anim.lottie_animation_get_framerate()
im_list = []
for frame in range(totalframe):
im = anim.render_pillow_frame(frame_num=frame)
im = im.quantize(255, method=Image.LIBIMAGEQUANT)
im_list.append(im)
im_list[0].save('animation.gif', save_all=True, append_images=im_list[1:], duration=int(frame_duration))
from rlottie-python.
Not exactly that you must use Image.LIBIMAGEQUANT
to improve quality.... I just happen to found that it did.
Well, if you think current save_animation
result is okay, then it's okay! Thank you.
from rlottie-python.
Related Issues (6)
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 rlottie-python.