You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking to "crop an image to its content". That is, remove/trim/crop all possible transparent pixels at the edges of the image.
In some cases, this is possible with the trim() function. But there are cases where trim() behaves weird (see #2842) and then there are cases where the top left pixel is not transparent, but the bottom or right side of the image have transparent parts that can be trimmed.
Have you searched for similar feature requests?
Yes
What would you expect the API to look like?
I'm not sure, maybe trimTransparent().
What alternatives have you considered?
I've searched around Google and Github to find a solution for this, even with other JS libraries, but I haven't found anything that can reliably achieve this.
Is there a sample image that helps explain?
Consider this image:
I'd like to trim all transparent pixels from the edges, resulting in this image:
The text was updated successfully, but these errors were encountered:
What are you trying to achieve?
I'm looking to "crop an image to its content". That is, remove/trim/crop all possible transparent pixels at the edges of the image.
In some cases, this is possible with the
trim()
function. But there are cases wheretrim()
behaves weird (see #2842) and then there are cases where the top left pixel is not transparent, but the bottom or right side of the image have transparent parts that can be trimmed.Have you searched for similar feature requests?
Yes
What would you expect the API to look like?
I'm not sure, maybe
trimTransparent()
.What alternatives have you considered?
I've searched around Google and Github to find a solution for this, even with other JS libraries, but I haven't found anything that can reliably achieve this.
Is there a sample image that helps explain?
Consider this image:
I'd like to trim all transparent pixels from the edges, resulting in this image:
The text was updated successfully, but these errors were encountered: