2010 02 27Core Image black fringes
That's a subtle one. When rotating a
CIImage
with [CIImage imageByApplyingTransform:t]
, you'll see incorrect blending between the image and its background. In this case, a black and grey image on a red background shows darker interpolated pixels than exist in both image and background.
Core Image is by default assuming a black border when blending the image. CIAffineClamp
mentions black fringes when using a Gaussian Blur — when blurring, Core Image will blend border pixels with black. Adding CIAffineClamp
will extend the image infinitely to blur border pixels with a copy of themselves.
CIAffineClamp
— this will remove black borders in CICrystallize
, CIPointillize
, … and all the blur filters.
Patrick Geiller
2010 02 27
Ah, I didn't try the scaling yet. Good to know it's also useful there.
(& thanks for the bug report !)
Yeah, affine clamp is your friend! We use it in Sandvox for scaling images so that the scaled images have opaque edges - otherwise the fractional edge pixels will be translucent. Similar to the above transform and blurring issue.
(BTW, your blog commenting input system is not handling HTML entities properly... if one tries to enter an ampersand here, the comment will be rejected.)