• 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: Image Colours
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Image Colours


  • Subject: Re: Image Colours
  • From: Jens Alfke <email@hidden>
  • Date: Sat, 03 Mar 2012 12:35:19 -0800

On Mar 3, 2012, at 5:17 AM, Amy Heavey wrote:

> I thought I would do this by analysing each image as it is saved and calculate the most common pixel colours, probably by analysing each pixel in the image? and saving the most common colours, perhaps 10 colours. Then I can see what other images have the same colour(s) in.

The trouble is that images tend to have subtle gradations of color, and even an area that looks solid often has adjoining pixels that are almost but not quite the same color. So you have to use approximations or averaging.

I haven’t done this myself, but one approach that might work is to lower the color resolution. Say you divide the raw pixel components by 16 so they’re only in the range 0…15 instead of 0…255. That way nearby colors will clump together into the same value. It also gives you only 4096 possible color values to count occurrences of, instead of 24 million.

It probably also makes a difference what color space you use. My hunch is that HSB or HSV will work better than RGB. Experiment!

—Jens
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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


  • Follow-Ups:
    • Re: Image Colours
      • From: Amy Heavey <email@hidden>
References: 
 >Image Colours (From: Amy Heavey <email@hidden>)

  • Prev by Date: Re: Unclear on -initWithBytesNoCopy:
  • Next by Date: Re: Question on handling very large images
  • Previous by thread: Re: Image Colours
  • Next by thread: Re: Image Colours
  • Index(es):
    • Date
    • Thread