[GH-ISSUE #129] Feature request: Focal point #53

Closed
opened 2026-02-25 22:34:14 +03:00 by kerem · 10 comments
Owner

Originally created by @poisa on GitHub (Sep 7, 2017).
Original GitHub issue: https://github.com/flyimg/flyimg/issues/129

Originally assigned to: @sadok-f, @baamenabar on GitHub.

I've worked in a closed-source version of a software that does pretty much the same as this. One very useful feature that it had was the ability to use an arbitrary point to crop an image to. In flyimg this is sort of achieved with the gravity parameter but it is not very precise. In the one I worked with you could specify an x and y focal point float that ranged from 0 to 1.

In the context of my use case, this served two main purposes:

  1. The user would upload an image and choose the focal point. No matter how we cropped the image, the "important" part (aka focal point) would always be in the center.
  2. We ran some images through face detection and set the focal point automatically to the center of the face. Then, cropped profile pictures would always look great even if a user uploaded an image with a weird aspect ratio.
Originally created by @poisa on GitHub (Sep 7, 2017). Original GitHub issue: https://github.com/flyimg/flyimg/issues/129 Originally assigned to: @sadok-f, @baamenabar on GitHub. I've worked in a closed-source version of a software that does pretty much the same as this. One very useful feature that it had was the ability to use an arbitrary point to crop an image to. In flyimg this is sort of achieved with the gravity parameter but it is not very precise. In the one I worked with you could specify an x and y focal point float that ranged from 0 to 1. In the context of my use case, this served two main purposes: 1. The user would upload an image and choose the focal point. No matter how we cropped the image, the "important" part (aka focal point) would always be in the center. 2. We ran some images through face detection and set the focal point automatically to the center of the face. Then, cropped profile pictures would always look great even if a user uploaded an image with a weird aspect ratio.
kerem 2026-02-25 22:34:14 +03:00
Author
Owner

@baamenabar commented on GitHub (Sep 8, 2017):

Yes! We are very aware of the limitations of gravity. We are reworking the whole cropping+resizing module to have more granular control and easier extensibility. I was precisely thinking about setting the focal point with 0 to 1 ranges for X and Y axis. I didn't have a name for it though. So expect this feature soon. Not next release, but probably the one after that.

Face detection integration will be much easier after we refactor the geometry module. And since we have face detection we can get not only profiles pictures generated, we can get group pictures "auto" cropped too, using the concentration of cages as gravity area. Although we don't have a timeline for that yet.

<!-- gh-comment-id:328034231 --> @baamenabar commented on GitHub (Sep 8, 2017): Yes! We are very aware of the limitations of gravity. We are reworking the whole cropping+resizing module to have more granular control and easier extensibility. I was precisely thinking about setting the focal point with 0 to 1 ranges for X and Y axis. I didn't have a name for it though. So expect this feature soon. Not next release, but probably the one after that. Face detection integration will be much easier after we refactor the geometry module. And since we have face detection we can get not only profiles pictures generated, we can get group pictures "auto" cropped too, using the concentration of cages as gravity area. Although we don't have a timeline for that yet.
Author
Owner

@bedoz commented on GitHub (Jun 26, 2018):

Hello everyone, there's some update about this issue? Any timing info about 1.2 version and it's milestone? Thank you very much

<!-- gh-comment-id:400227716 --> @bedoz commented on GitHub (Jun 26, 2018): Hello everyone, there's some update about this issue? Any timing info about 1.2 version and it's milestone? Thank you very much
Author
Owner

@sadok-f commented on GitHub (Aug 31, 2018):

This is a very interesting Feature request, sorry it took us a while before reply to you.
To summarize it'll be great if we can add a smart-crop option which will focus on the most important part of an image for cropping.
For the face-detection part we can call it a smart-face-crop option.
@poisa Thanks again for this feature, we gonna work on it soon.
@bedoz Soon :)

<!-- gh-comment-id:417653590 --> @sadok-f commented on GitHub (Aug 31, 2018): This is a very interesting Feature request, sorry it took us a while before reply to you. To summarize it'll be great if we can add a smart-crop option which will focus on the most important part of an image for cropping. For the face-detection part we can call it a smart-face-crop option. @poisa Thanks again for this feature, we gonna work on it soon. @bedoz Soon :)
Author
Owner

@joshbrw commented on GitHub (Jun 6, 2019):

I've had a play around with this library and the feature-set that you offer is absolutely amazing considering it is open source. Unfortunately without being able to do a crop with the face as the focal point it can't be considered in the same league as Cloudinary 😞 Are there still plans to add this feature in?

<!-- gh-comment-id:499401424 --> @joshbrw commented on GitHub (Jun 6, 2019): I've had a play around with this library and the feature-set that you offer is absolutely amazing considering it is open source. Unfortunately without being able to do a crop with the face as the focal point it can't be considered in the same league as Cloudinary 😞 Are there still plans to add this feature in?
Author
Owner

@sadok-f commented on GitHub (Jun 11, 2019):

Hi @joshbrw,
Thank you for your interest in our project and your kind words about it.
Unfortunately, we didn't find a proper time to get around this issue and implement it.
I'll try my best to implement it asap.
Thank you again for your support!

<!-- gh-comment-id:500822291 --> @sadok-f commented on GitHub (Jun 11, 2019): Hi @joshbrw, Thank you for your interest in our project and your kind words about it. Unfortunately, we didn't find a proper time to get around this issue and implement it. I'll try my best to implement it asap. Thank you again for your support!
Author
Owner

@fhferreira commented on GitHub (Nov 2, 2020):

+1 It will be awesome

<!-- gh-comment-id:720522179 --> @fhferreira commented on GitHub (Nov 2, 2020): +1 It will be awesome
Author
Owner

@bedoz commented on GitHub (Nov 3, 2020):

Yeah i want to renew my request to this feature...

<!-- gh-comment-id:721006351 --> @bedoz commented on GitHub (Nov 3, 2020): Yeah i want to renew my request to this feature...
Author
Owner

@sadok-f commented on GitHub (Nov 3, 2020):

Thank you for your message, I'm sorry regarding this delay.
This feature request will be a high priority and hopefully, we'll release it soon.

<!-- gh-comment-id:721020951 --> @sadok-f commented on GitHub (Nov 3, 2020): Thank you for your message, I'm sorry regarding this delay. This feature request will be a high priority and hopefully, we'll release it soon.
Author
Owner

@fhferreira commented on GitHub (Nov 3, 2020):

I have used the https://imagekit.io/ they have a good "Smart Crop"

<!-- gh-comment-id:721158528 --> @fhferreira commented on GitHub (Nov 3, 2020): I have used the https://imagekit.io/ they have a good "Smart Crop"
Author
Owner

@sadok-f commented on GitHub (Jan 2, 2021):

We're happy to announce the release of the smart cropping feature: https://github.com/flyimg/flyimg#smart-crop
It would be great if you could test it out and provide feedback about it!
@fhferreira , @bedoz , @joshbrw

Thank you All for your support and help!

<!-- gh-comment-id:753495300 --> @sadok-f commented on GitHub (Jan 2, 2021): We're happy to announce the release of the smart cropping feature: https://github.com/flyimg/flyimg#smart-crop It would be great if you could test it out and provide feedback about it! @fhferreira , @bedoz , @joshbrw Thank you All for your support and help!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flyimg#53
No description provided.