0

I am trying to load a scaled down version of an image without loading original sized image into memory. To reach this goal I was using ImageIO framework. However in this case I face unacceptable loss of quality.

This way I can re-size my image, however original size has to be loaded into memory.

Is there a way to get good quality lower resolution image without loading large image into memory?

Using apple libraries would be preferable, but if there is no other way, third-party library would also be acceptable.

Harazi
  • 122
  • 1
  • 10
  • Can you speak a little further as to what you attempted with ImageIO? Was it just the thumbnail functionality or did you try something else? – Tommy Aug 06 '14 at 15:35
  • Yes, it was thumbnail functionality `CGImageRef image = CGImageSourceCreateThumbnailAtIndex (imageSource, 0, otpions);` Here imageSource is an instance of `CGImageSourceRef` and options are defined in an instance of `CFDictionaryRef`. In options preferred size is set, also kCGImageSourceCreateThumbnailWithTransform and kCGImageSourceCreateThumbnailFromImageAlways, because the idea is to re-size depending on preferred size, witch can vary. – Harazi Aug 07 '14 at 08:13

1 Answers1

1

May be Accelerate.framework can help. Use vImageScale_Planar8 to resize image. As I know, this framework supports tiling, probably it will reduce memory required.

kelin
  • 11,323
  • 6
  • 67
  • 104
  • 1
    Indeed it does have some advantages, not quit what I was looking for, however since no better solution was provided, this will do. And also lets not let that bounty go to waste :). – Harazi Aug 08 '14 at 07:53
  • Please, post a comment when you will finish with trying this framework. It's interesting :) – kelin Aug 08 '14 at 09:45