esimov / caire

Content aware image resize library
MIT License
10.36k stars 384 forks source link

Support masks #68

Closed VelocityRa closed 2 years ago

VelocityRa commented 3 years ago

Is your feature request related to a problem? Please describe.

For people/animal inputs (or anything whose proportions shouldn't change) this project very often resizes those instead of other things like the environment ie. a background landscape.

It does not seem usable for me for anything other than landscapes or abstract images. I use it like so:

caire -in input.jpg -out output.jpg -face=1 -width=400 -height=300

Describe the solution you'd like

Masking support. An optional protective binary mask image file, like this from https://github.com/andrewdcampbell/seam-carving.

-mask: (Optional) The path to the protective mask. The mask should be binary and have the same size as the input image. White areas represent regions where no seams should be carved (e.g. faces).

Describe alternatives you've considered

Using the above project. But there are no releases/binaries, it's not as easy to use.

VelocityRa commented 3 years ago

For anyone else on Windows wanting this feature, I did find this tool that does the job & also has a GUI: https://seam-carving-gui.en.softonic.com

esimov commented 3 years ago

That's a good request and the implementation should be straightforward and hopefully without too much difficulty. It should be applied the same logic as for people face retention but this time applied on the provided binary file. I will take care when my time permits.

esimov commented 2 years ago

The requested feature has been implemented. Please test it out and let me know your thoughts. Soon a new release will follow.

VelocityRa commented 2 years ago

I have no need for this anymore, but I trust it works :) might as well close.