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

How create indexed image? #389

Closed
BratSinot opened this issue Apr 20, 2015 · 4 comments
Closed

How create indexed image? #389

BratSinot opened this issue Apr 20, 2015 · 4 comments

Comments

@BratSinot
Copy link

I found function "image::imageops::colorops::dither", what convert pixel colors, but image still RGB. "image::imageops::colorops::index_colors" return indexes, not image. So how create custom image with palette?

@nwin
Copy link
Contributor

nwin commented Apr 20, 2015

There is no generic interface yet to make use of these functions. But you can simply save the image as GIF (paletted PNG is not supported yet), that will reduce the image to 256 colors.

@nwin nwin closed this as completed Apr 20, 2015
@Hugo-Trentesaux
Copy link

So there is no way of creating PNG with indexed color profile?

Example of use case: https://zola.discourse.group/t/image-processing-using-indexed-colors-profiles/499/3

@fintelia
Copy link
Contributor

I believe that the PNG crate supports it now (see Encoder::set_palette), but there aren't plans to expose that functionality in this higher level crate.

@HeroicKatora
Copy link
Member

HeroicKatora commented Jul 20, 2020

I would recommend opening a new issue, for example to discuss a potential interface for this. For comparison gif is essentially always an indexed color profile and, as fintelia mentioned, png does support it so I wouldn't rule out adding support for it in some way. Posting on a closed issue from 5 years ago however will be limited in usefulness, a lot of things have changed and only maintainers and the original posters get notified.

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

No branches or pull requests

5 participants