• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Best format and method for very fast CGImage resizing [Solved]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best format and method for very fast CGImage resizing [Solved]


  • Subject: Re: Best format and method for very fast CGImage resizing [Solved]
  • From: Ken Tozier <email@hidden>
  • Date: Mon, 23 Apr 2007 20:05:57 -0400


On Apr 23, 2007, at 4:18 PM, David Duncan wrote:

On Apr 22, 2007, at 1:07 PM, Ken Tozier wrote:

As it stands now, I create the thumbnails as a CGImages inside a CGUtilCreateBitmapContext. Should I convert them to CIImages? NSImages? From there, what would be faster: An affine transform in the draw method? Or a CIImage transform?

The biggest win won't so much be from which method you use to store your thumbnails, as how you decide to store them. If you draw thumbnails as just a scaling down of the original image every time, then you will see fairly poor performance. If you have a maximum size for your thumbnails, preprocessing them into that maximum size from the originals will increase your performance greatly. If quality is a concern (and when isn't it!) then always make sure that you are scaling down rather than up.


From the pure CoreGraphics side of things, a CGImage or CGLayer would be the best way to store the thumbnails. CIImages don't store images so much as instructions for creating an image, so you will have to have your images in a CGImage or CGLayer before you could pass it to Core Image anyway (although Core Image may provide you with better scaling algorithms and better performance in general if it can work entirely on the video card).

Just to see what happens, I tried an affine transform on the CGContext and it turned out to be plenty fast. I can zoom and shrink 100 page thumbnails with no observable lag so that's good enough for me.


Ken
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Best format and method for very fast CGImage resizing (From: Ken Tozier <email@hidden>)
 >Re: Best format and method for very fast CGImage resizing (From: David Duncan <email@hidden>)

  • Prev by Date: Re: NSOpenPanel -runModalForDirectory:file:types: won't select file
  • Next by Date: Re: SetSystemUIMode disabling Exposé hotkeys
  • Previous by thread: Re: Best format and method for very fast CGImage resizing
  • Next by thread: Writing to a specified NSUserDefaults domain
  • Index(es):
    • Date
    • Thread