How to Crop image white space automatically using jQuery?
What is ‘image white space’?
I imagine leading and trailing rows and columns with just white pixels.
You can’t with jQuery, you can with the canvas API.
Draw image to canvas, get image data from canvas, iterate over the pixels removing leading and trailing rows and columns and then put the image data back on the canvas.
This might help you to get started: http://www.html5canvastutorials.com/advanced/html5-canvas-get-image-data-tutorial/ it has all the bits you need.
>I imagine **leading and trailing rows and columns with just white pixels**
I have no idea what that means. How does an image have those…where are they coming from?
Does it work for “blue space”?
You must be logged in to reply to this topic.
Search for Stuff
Browse the Archives
Get the Newsletter
... or get the RSS feed