Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BitmapDecoder should support gif #3

Open
seven332 opened this issue Nov 4, 2016 · 2 comments
Open

BitmapDecoder should support gif #3

seven332 opened this issue Nov 4, 2016 · 2 comments

Comments

@seven332
Copy link
Owner

seven332 commented Nov 4, 2016

Only decode the first frame of the gif image, just like what skia does.

@inorichi
Copy link
Contributor

inorichi commented Apr 5, 2018

What steps should be followed here? I have this in mind:

  1. Decode the first frame completely (there's no line by line decoding nor regions)
  2. Move the selected region (if there's any) to the beginning of the array (with memmove), so that we don't need to alloc more memory for a copy.
  3. Create a new container for the scaled image.
  4. Downscale the image (using the container as destination for the pixels) applying some filter: nearest, bilinear, bicubic, lanczos... which one?

@seven332
Copy link
Owner Author

seven332 commented Apr 7, 2018

GIF is an indexed-color image type. The result in your step 1 is the color-index array of the whole first frame (some image information as well). So the step 2 should be generating the selected region raw image(like RGBA array). Then step 3, downscale the image. Maybe the step 2 and the step 3 can combine to save memory.

Bilinear is good enough for downscaling. That is what Android OpenGL ES used in default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants