-
-
Notifications
You must be signed in to change notification settings - Fork 756
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
Is an 'auto-crop' feature scheduled? #70
Comments
jimp is so lowe level and so straightforward to use that a feature like that, so specific, would not add much value and instead add complexity. You layed out the algorithm, now it's a matter of implementing it 😄 |
Yup! I did never read throughtfully jimp docs, now I see there is a |
@marcolino, I'm happy to include in an auto-crop method. If you implement it and make a pull request, I'll happily pull it in. Alternatively, if you can write a simple method using the API and post it here, I'll add it to the code base. |
Hi! |
|
Yes... I forgot to fork, but did clone directly from your repo... :-( |
Merged the pull request here: #71 Thanks! |
Sorry, last question: I have already some minor changes to autocrop... Should I create a new PR, or what? |
Sure thing, just create a new pull request from the fork you have. I think you might even be able to do it in the same thread: #71 |
Is an
auto-crop
feature scheduled any point in time?I mean: some images have one-color borders, which can be sometimes annoying, something that distracts from the real image contents...
I suppose it should not be so difficult, to implement (knowing the inners of jimp... :-): you should check the colors of the most external pixel for each one of the four borders: if they are all the same, you should crop that side by one pixel, and continue with the next pixel...
As an edge case, you could finish with an empty image (if the source image was just one color)... That should be fine, of course (auto-cropping one-color image is a quite silly operation in itself... :-).
For example, from:
![amb](https://cloud.githubusercontent.com/assets/849127/11170084/91a66b6a-8bca-11e5-9995-b0c6b2cccf78.png)
to:
![am](https://cloud.githubusercontent.com/assets/849127/11170086/9acc79be-8bca-11e5-8b9b-277301254416.png)
The text was updated successfully, but these errors were encountered: