• 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: CILinearGradient not linear?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CILinearGradient not linear?


  • Subject: Re: CILinearGradient not linear?
  • From: Christian Walther <email@hidden>
  • Date: Tue, 30 May 2006 10:29:11 +0200

George Orthwein wrote:
The CTGradient looks almost identical to the Photoshop gradient but the Core Image gradient differs quite a bit... showing more lighter tones and then dropping to black very quickly at the end. The midpoint is 32% black instead of 50%.

A wild guess without any knowledge about Core Image whatsoever (and without having tried out your suggestions):


It seems that both gradients are actually "linear", they're just linear to different quantities.

The CT and Photoshop gradients are probably linear in the pixel values they send to video hardware - 0 for black, 255 for white, and 128 for the middle gray in the center. Incidentally, this is also approximately linear in perceived brightness.

The CI gradient is probably linear in actual physical light intensity. Try comparing this gradient with a checkerboard pattern of white and black pixels (if you're on an LCD, on a CRT use alternating white and black horizontal lines), you'll see that it approximately matches the brightness in the middle of the gradient.

On a properly calibrated Mac display, the relationship is that light_intensity = pixel_value ^ 1.8, with both quantities measured from 0 to 1. In your example: 0.5 = 0.68 ^ 1.8, with 0.68 being the complement of your "32% black".

If this sounds all greek to you, read up on "gamma", especially <http://www.poynton.com/notes/colour_and_gamma/GammaFAQ.html>, or on colorimetry in general. It's a wide and not completely trivial field, but understanding it helps a lot if you're seriously interested in computer graphics.

 -Christian
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >CILinearGradient not linear? (From: George Orthwein <email@hidden>)

  • Prev by Date: Re: NSSplitview - where is it?
  • Next by Date: NSSplitview - where is it?
  • Previous by thread: CILinearGradient not linear?
  • Next by thread: make sure one timer fire before another
  • Index(es):
    • Date
    • Thread