Git Product home page Git Product logo

Comments (13)

Twinside avatar Twinside commented on July 30, 2024

Do you mean while decompressing?

from juicy.pixels.

seanparsons avatar seanparsons commented on July 30, 2024

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.

Twinside avatar Twinside commented on July 30, 2024

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.

Twinside avatar Twinside commented on July 30, 2024

Do you have an image to share for the test suite?

from juicy.pixels.

seanparsons avatar seanparsons commented on July 30, 2024

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.

Twinside avatar Twinside commented on July 30, 2024

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.

seanparsons avatar seanparsons commented on July 30, 2024

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.

Twinside avatar Twinside commented on July 30, 2024

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.

seanparsons avatar seanparsons commented on July 30, 2024

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.

Twinside avatar Twinside commented on July 30, 2024

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.

seanparsons avatar seanparsons commented on July 30, 2024

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.

Twinside avatar Twinside commented on July 30, 2024

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.

seanparsons avatar seanparsons commented on July 30, 2024

This looks to work like a treat from what I can tell, cheers for this.

from juicy.pixels.

Related Issues (20)

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.