h2non / imaginary

Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing
https://fly.io/docs/app-guides/run-a-global-image-service/
MIT License
5.5k stars 455 forks source link

Resize PNG without antialiasing #402

Open mistermiracl opened 1 year ago

mistermiracl commented 1 year ago

I have an image that is fully white, meaning it doesn't have any pixels for antialias all the pixels are white, I would like to keep it that way, but when I resize the image this antialias pixels are added to its borders, is it possible to not do that using imaginary?

antialiased triangle pixelated triangle

every pixel in the pixelated triangle is not completely white but it should be, its just an example

if you're opening the images in a browser you might need to use image-rendering: pixelated; to see what I'm talking about

held-m commented 1 year ago

Same problem image image

held-m commented 1 year ago

I figured it out. This is not a bug of imaginary. It's a bug of libvips.

mistermiracl commented 1 year ago

I figured it out. This is not a bug of imaginary. It's a bug of libvips.

You're right, should've updated this issue, here's the discussion on libvips repo, hope its useful!

https://github.com/libvips/libvips/discussions/3083