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

Other input formats? #480

Open
ILoveGoulash opened this issue Dec 18, 2022 · 6 comments
Open

Other input formats? #480

ILoveGoulash opened this issue Dec 18, 2022 · 6 comments
Labels
I-Minor Issues that would be nice to have fixed, but are the lowest priority T-Feature Requests for a new feature to be added

Comments

@ILoveGoulash
Copy link

Hello, I used to use optipng on the output of long image processing pipelines and when doing so, I chose the simplest possible interchange format to avoid any useless encoding cost.
Usually, it was PPM (since I knew my input didn't have an alpha channel).

Would it be possible for oxipng to support at least one such format? Netpbm would probably be the most suitable and the image crate seems to have support for some of them (https://docs.rs/image/latest/image/codecs/pnm/index.html).

For an idea of the "cost" of using PNG in this situation (multiplied by num_images / num_cpu):

$ magick identify /tmp/tmp.ppm
/tmp/tmp.ppm PPM 5551x6380 5551x6380+0+0 8-bit sRGB 101.324MiB 0.120u 0:00.087
$ time magick convert -define png:compression-level=0 /tmp/tmp.ppm /tmp/tmp.png
magick convert -define png:compression-level=0 /tmp/tmp.ppm /tmp/tmp.png  1.72s user 0.16s system 182% cpu 1.033 total
$ time magick convert /tmp/tmp.ppm /tmp/tmp2.ppm
magick convert /tmp/tmp.ppm /tmp/tmp2.ppm  0.19s user 0.11s system 99% cpu 0.300 total
$ time magick convert /tmp/tmp.ppm /tmp/tmp.pam
magick convert /tmp/tmp.ppm /tmp/tmp.pam  0.18s user 0.11s system 99% cpu 0.289 total
$ time magick convert /tmp/tmp.ppm /tmp/tmp.miff
magick convert /tmp/tmp.ppm /tmp/tmp.miff  0.19s user 0.11s system 99% cpu 0.302 total
@TPS
Copy link

TPS commented Dec 19, 2022

Maybe work on #376 might help this (or vice versa)?

@ILoveGoulash
Copy link
Author

It is definitely related, at least for internal code structure matters.

@chrispy-snps
Copy link

I would also be interested in support for GIF and BMP as input formats.

@Vasilich
Copy link

I would also be interested in support for GIF and BMP as input formats.

what do you want to optimize on BMP format, that has no compression?

@chrispy-snps
Copy link

what do you want to optimize on BMP format, that has no compression?

I want to convert them to PNG, then optimize them. It can be done with sequential commands (convert then oxipng), but there is convenience in integrating the format support so things like xargs and parallel can be more easily used.

@TPS
Copy link

TPS commented Apr 13, 2023

what do you want to optimize on BMP format, that has no compression?

@Vasilich FYI, BMP has optional simple compression. 🙇🏾‍♂️

@andrews05 andrews05 added T-Feature Requests for a new feature to be added I-Minor Issues that would be nice to have fixed, but are the lowest priority labels Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-Minor Issues that would be nice to have fixed, but are the lowest priority T-Feature Requests for a new feature to be added
Projects
None yet
Development

No branches or pull requests

5 participants