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

exposed palette from GET endpoints #380

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

vaibsharma
Copy link
Contributor

@vaibsharma vaibsharma commented Feb 9, 2022

Hey @h2non,

Hope you're well. In reference to this issue #378. Can you please have a look at this PR.
This enable palette for all the APIs that requires to save the image in PNG.

Without Palette - https://aqueous-reef-74512.herokuapp.com/resize?width=200&height=200&url=https://raw.githubusercontent.com/h2non/imaginary/master/testdata/large.jpg&type=png
(Image size - 39KB)

After Palette - https://aqueous-reef-74512.herokuapp.com/resize?width=200&height=200&url=https://raw.githubusercontent.com/h2non/imaginary/master/testdata/large.jpg&type=png&palette=true
(Image size - 19KB)

Let me know if there are more changes needed here.

Thanks& Regards,
Vaibhav

@vaibsharma
Copy link
Contributor Author

vaibsharma commented Feb 9, 2022

I also checked this @h2non https://github.com/libvips/libvips/blob/v8.12.2/libvips/foreign/pngsave.c#L548

Is it a good idea to add Quality param in bimg here https://github.com/h2non/bimg/blob/master/vips.h#L333? The default value is 100. Getting some really good results even with 50 quality and definitely smaller image size.

Played with effort param as well with palette enabled. It is easy to tune CPU usage while processing the images. Might help a few others like me :)

Would love to get your feedback.

@h2non
Copy link
Owner

h2non commented Feb 9, 2022

LGTM, thanks!

@h2non
Copy link
Owner

h2non commented Feb 9, 2022

Would you like to support effort param for AVIF encoding? Here the bimg field.

@h2non
Copy link
Owner

h2non commented Feb 9, 2022

Is it a good idea to add Quality param in bimg here https://github.com/h2non/bimg/blob/master/vips.h#L333?

Quality param is already supported and it is used in different image formats at processing time. If you detect any issue with that, please report it and provide further details.

@vaibsharma
Copy link
Contributor Author

Hey @h2non

Would you like to support effort param for AVIF encoding? [Here the bimg field](https://github.com/h2non/bimg/blob/master/options.go#L229-L230).

Yeah sure @h2non. Should I submit separate PR for this?

Thanks

@h2non
Copy link
Owner

h2non commented Feb 10, 2022

Yeah sure @h2non. Should I submit separate PR for this?

Sounds good, I can merge and close this one.

Copy link
Owner

@h2non h2non left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@h2non h2non merged commit 5f473e5 into h2non:master Feb 10, 2022
wslaghekke added a commit to recognizegroup/imaginary that referenced this pull request Feb 1, 2023
* Fixed Timeout in readme, 30 ~> 60 (h2non#340)

* Fix invalid parameters "-path-prefix" (h2non#344)

* fix: small errors in docs (h2non#346)

* fix: use proper formatter for usage template (h2non#347)

Co-authored-by: Mads Moeller <madsmm@gmail.com>

* Add Cloud Run Button (h2non#362)

* Delete app.json

* Update README.md

* Update README.md

* updated docker builder OS to go version 1.17 (h2non#371)

* fix(readme): remove gocard obsolete badge

* feat(readme): update placeholder description

* fix(readme): update fly deploy tutorial

* fix(docs): allowed-origins examples h2non#333

* memory leak issue fixed with jemalloc (h2non#381)

* exposed palette from GET endpoints (h2non#380)

* Updated Dockerfile (h2non#384)

1. Changed base image to bullseye
2. The updated base image contains an updated version of libjemalloc too, so building from source is no longer necessary
3. Updated libvips version too

* Added dev container (h2non#385)

* Added dev container

* Removed irrelevant lines

* allow speed from get (h2non#383)

* allow speed from get

* updating the version to use effor param in libvips

* Return with and heigh of the generated images (h2non#382)

* Return with and heigh of the generated images

Use case:

When using the fit image transformation, it is helpful to know the size
of the resulting image without having to either read the image locally
or do another request to the info endpoint.

Used in: nextcloud/server#24166

Signed-off-by: Carl Schwan <carl@carlschwan.eu>

* Make mimetype support always return true

* Add command line option to enable this feature

Signed-off-by: Carl Schwan <carl@carlschwan.eu>

* refactor: remove deprecated X- prefix in response headers

Co-authored-by: Tom <tomas@aparicio.me>

* Decompression exploit check (h2non#404)

* Bump bimg version to 1.1.7

* Add decompression bomb exploit check

* Update README with new flag

* Fix tests

* Fix typos (h2non#405)

Found via `codespell -S .git`.

---------

Co-authored-by: Julian <2564520+judomu@users.noreply.github.com>
Co-authored-by: liuxu <i@liuxu.me>
Co-authored-by: 0xflotus <0xflotus@gmail.com>
Co-authored-by: Mads Moeller <mmoeller@users.noreply.github.com>
Co-authored-by: Mads Moeller <madsmm@gmail.com>
Co-authored-by: James Ward <james@jamesward.com>
Co-authored-by: Angelo Girardi <angelo.girardi@goat.com>
Co-authored-by: Tom <tomas@aparicio.me>
Co-authored-by: Vaibhav Sharma <vaib.sharma44@gmail.com>
Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Vaibhav Sharma <vaibhavsharma.v@udaan.com>
Co-authored-by: Carl Schwan <carl@carlschwan.eu>
Co-authored-by: SeaaaaaSharp <98841125+SeaaaaaSharp@users.noreply.github.com>
Co-authored-by: Kian-Meng Ang <kianmeng.ang@gmail.com>
suntong pushed a commit to suntong/imaginary that referenced this pull request Nov 28, 2023
suntong pushed a commit to suntong/imaginary that referenced this pull request Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants