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

Some results #22

Closed
capedra opened this issue Oct 17, 2020 · 3 comments
Closed

Some results #22

capedra opened this issue Oct 17, 2020 · 3 comments

Comments

@capedra
Copy link

capedra commented Oct 17, 2020

For example:

Photo 1:
Original:
https://i.ibb.co/stYZ06K/IMG-1710.jpg
Without background:
https://i.ibb.co/dG9XC67/4003573022147-F.png

Photo2:
Original:
https://i.ibb.co/dbyn9bt/IMG-1722.jpg
Without background:
https://i.ibb.co/J5kRwSD/4003573022024-F.png

@ondrejbartas
Copy link

@capedra I am working with rembg naively but with product pictures I got better results when zooming image out:

curl -L --fail --show-error -s https://i.ibb.co/stYZ06K/IMG-1710.jpg | \
convert - -set option:distort:viewport "%[fx:w+400]x%[fx:h+400]"-200-200 -virtual-pixel Edge -distort SRT 0 +repage png:-

 |\
curl -s T -F file=@- http://localhost:5000/| \
convert -crop +200+200 -crop -200-200 - png:output.png

Curl downloads image,
first convert adds 200px border
intermidiate
then I send image to rembg server
and then crop by 200px around image

output

Also by using convert it will automatically read exif metadata of input image and rotate it correctly for next usage.

@capedra
Copy link
Author

capedra commented Oct 23, 2020

@danielgatis @ondrejbartas But then I need to trim the output image, which is something that this library could do as well. Thanks a lot for helping me out!

@ondrejbartas
Copy link

@capedra

Look at imagemagick trim function, i am writing this from phone so look at documentation of convert with options trim and fuzzy

Did it helped?

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

3 participants