Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How to Crop image white space automatically using jQuery?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #44930
    Robin
    Participant

    How to Crop image white space automatically using jQuery?

    #135846
    Paulie_D
    Member

    What is ‘image white space’?

    #135872
    CrocoDillon
    Participant

    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.

    #135874
    Paulie_D
    Member

    >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”?

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.