Comments (13)
Do you mean while decompressing?
from juicy.pixels.
I can decode it to the series of images, but I don't know for each pixel in each frame what the transparency is. Given the slightly interesting way the GIF format works, it's not even that there would be a single transparency colour.
from juicy.pixels.
Ah ok, as the transparency is just a "transparent" color in GIF I didn't bother to make the conversion. I'll put in the todo list.
from juicy.pixels.
Do you have an image to share for the test suite?
from juicy.pixels.
Is this bit even correct?
https://github.com/Twinside/Juicy.Pixels/blob/master/src/Codec/Picture/Gif.hs#L594-L597
It looks like if the pixel is transparent rather than adding the transparent pixel it looks to the previous frame for what was in that position.
from juicy.pixels.
There is no alpha channel in the gif format, it's either fully transparent or fully opaque. For each image, the transparent color is given in its header.
from juicy.pixels.
I don't think you read what I said, that code checks if it's outside the bounds and not transparent, if fails either of those checks it falls back to the previous frame. So if I had one full frame with a picture on it and another frame that was the same size and transparent then both frames would contain the picture in them.
from juicy.pixels.
That's the intended behavior, it is used by the gif animations to encode only a part of the full image and reuse the background of the previous image, thus saving space in the final image.
from juicy.pixels.
I could be misunderstanding the code, so bear with me if I'm wrong I just want to make sure. :)
If a pixel is set to the transparency colour in all cases it will either be the same pixel from the previous image or whatever the background image is at that position.
from juicy.pixels.
Yes, that's the idea.
My last commit made some changes to handle gif with transparency by providing a default transparency background, is this working for you? (The change breaks the API, I'll have to bump juicy.pixels to 3.2)
from juicy.pixels.
I've rigged it up with add-source, but hilariously in my case it's going for an old version of criterion which is failing to compile. Seems a pain that I can't tell it to ignore the executables.
from juicy.pixels.
ah, I usually delete the executable part of the cabal file before releasing, I should put it as a test suite instead.
from juicy.pixels.
This looks to work like a treat from what I can tell, cheers for this.
from juicy.pixels.
Related Issues (20)
- Transparent gifs
- EXIF files are misidentified as TIFF instead of JPEG in metadata
- `readMetadata`, without decoding image HOT 2
- Add option to apply JPEG rotation to image
- Width and height incorrect for exif image
- Loosen bounds on bytestring HOT 1
- What does this sentence means?
- Refine(cast) DynamicImage to specific Image HOT 1
- Read EXIF data also from PNGs
- Distortion (and possibly segfault) in decoding a certain JPEG HOT 2
- Impossible - typeOfData : Exifone
- Plans to encode webp? HOT 2
- Loosen bounds on Vector
- add "instance TestEquality Keys"
- Infinite loop in palettize
- The test suite never fails
- `Metadatas` skips over entries that contain non-ascii unicode characters.
- Revise bounds on hackage to allow latest deepseq
- Missing changelog for 3.3.8
- New release? HOT 3
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 juicy.pixels.