0

Is there any pure JavaScript way to reduce the quality to a specified size? For example if someone tries to upload a 12MP image is there any way to reduce this to 5MP for example? At the moment we are using Aurigma, but would like to get away from the reliance on a plugin that the user may or may not have.

SO recommended this post as a possible question/answer, but this seems to deal with cropping the image. I'm needing to reduce the size of the image client side. Is this something that is possible? Is there a plugin for jQuery that does this?

Community
  • 1
  • 1
Jared
  • 5,840
  • 5
  • 49
  • 83
  • there are zillions of google results for this: http://www.google.com/search?q=jquery+resize+image+plugin – user428517 Jan 28 '13 at 19:20
  • @sgroves: No need for jQuery. Simply load the image into a canvas and resize it. – Zeta Jan 28 '13 at 19:23
  • 2
    See this question/answer http://stackoverflow.com/questions/961913/image-resize-before-upload – The Who Jan 28 '13 at 19:25
  • @sgroves I don't know if you looked at most of those as I had searched previously with a nearly identical search string. Most of those deal with the specified height and width to display...not reducing quality. Resize is a tricky word for finding content relevant to my issue. – Jared Jan 28 '13 at 19:41
  • @TheWho that post had some good info. Thanks! The plupload tool that was suggested looks surprisingly capable for an html5 implementation. – Jared Jan 28 '13 at 19:41
  • Notice that this not called quality reduction, it is just a dimension resizing. By reducing the dimension you might actually increase the quality (given some quality metric) since you might suppress noise created during the image acquisition. To actually reduce the quality (and improve compression factor) you could use the DCT transform to pick only some of the more relevant coefficients (like JPEG does). – mmgp Jan 28 '13 at 20:39
  • 1
    @jared I have used plupload and I am very happy with it. – The Who Jan 29 '13 at 16:20
  • @TheWho can you please answer the question with a direct link to the plupload tool and a short explanation of capabilities/other relevant info (so that it's a "good" answer). Like to give some rep since I found your reference extremely helpful. – Jared Jan 30 '13 at 04:40

1 Answers1

1

You try using the Plupload library. I have been using it for multiple file uploads, but never its PNG, JPEG resize capabilities.

There is a related question at Image resize before upload

Community
  • 1
  • 1
The Who
  • 6,552
  • 5
  • 36
  • 33