3

In Flex, I am using graphics.codec.JPEGEncoder to save image files that are edited inside application (normal manipulations like brightness etc.) I am able to save files perfectly. What I want to know is that is there any way I can save the image with a better dpi? Say, for instance the image that is loaded and manipulated was originally of 72dpi, now can I save it with a dpi of 150 or 300 ? If so, how to do it.

Doesn't have to be using the JPEGEncoder, if there's any way to do it at all, like using any library etc, I am okay with it. Any suggestions?

Note: If it matters, I am using Bitmapdata to store the image and manipulations and saving the image with JPEGEncoder by supplying it's data as bytearray like below.

var imageBytes:ByteArray = encoder.encode(myBitmapData);
redGREENblue
  • 3,076
  • 8
  • 39
  • 57
  • What is the DPI of your monitor? Really to get a screenshot at a higher DPI than that you have to run it through some form of conversion process which adds more pixels. When I was Editor in Chief of Flex Authority, we gave people this link: http://www.turbophoto.com/Photoshop-Tricks/screenshot-photoshop-trick/index.htm . I have no idea how to do such a conversion in AS3. – JeffryHouser Jun 14 '11 at 20:47
  • 1
    I'm fairly sure DPI has nothing to do with JPEG. DPI is just a measurement for printing purposes. The file you save will *never* be of a specific DPI (of course, there's metadata for that), but really what it comes down to is how big your image will become which can be calculated easily enough. – J_A_X Jun 15 '11 at 14:06

1 Answers1

2

If you say you want to save a 72 dpi image as 150 or 300 dpi image, then it should be in your case essentially an enlargement and you have to use something like bicubic interpolation for this.

splash
  • 13,037
  • 1
  • 44
  • 67