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

Keeping transparent pixels when using the API #424

Closed
spillerrec opened this issue May 17, 2017 · 2 comments
Closed

Keeping transparent pixels when using the API #424

spillerrec opened this issue May 17, 2017 · 2 comments

Comments

@spillerrec
Copy link
Contributor

I wan't to try using FLIF instead of WebP for one of my projects, but it stores special information in transparent pixels used when overlaying two images. However I cannot find out how to get it stop using the default behavior of only being visual lossless. (Which I personally find terrifying, as I expect lossless formats not to modify my data.)

I have tried to call flif_encoder_set_alpha_zero_lossless but that does not appear to do anything. #349 might be related.

Test image:
transparent-noise
Test image end. Ends up being 20 bytes when using the API, instead of 617 KiB with -K.

@jonsneyers
Copy link
Member

You have to set the option before calling flif_encoder_add_image, maybe that is the problem?

@spillerrec
Copy link
Contributor Author

spillerrec commented May 18, 2017

I'm calling it right after flif_create_encoder. Call order of all FLIF functions:

  1. flif_create_encoder()
  2. flif_encoder_set_alpha_zero_lossless( encoder );
  3. flif_create_image( width, height )
  4. flif_image_write_row_RGBA8 * height
  5. flif_encoder_add_image
  6. flif_destroy_image
  7. flif_encoder_encode_memory
  8. flif_destroy_encoder

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