addborder.m

arborddither.m

batchloader.m

bicoloradapt.m

blockify.m

cpicktool.m

colorpict.m

csview.m

cropborder.m

dilatemargins.m

displace.m

driftds.m

eoframe.m

eoline.m

findpixels.m

fourdee.m

gifread.m

arborddither.m

batchloader.m

bicoloradapt.m

blockify.m

cpicktool.m

colorpict.m

csview.m

cropborder.m

dilatemargins.m

displace.m

driftds.m

eoframe.m

eoline.m

findpixels.m

fourdee.m

gifread.m

gifwrite.m

glasstiles.m

hsi2rgb.m

hsy2rgb.m

husl2rgb.m

im2ods.m

im2spectrogram.m

imadjustFB.m

imblend.m

imcast.m

imcompare.m

imcompose.m

imdestroyer.m

imdrag.m

imecho.m

imgenerate.m

imlnc.m

glasstiles.m

hsi2rgb.m

hsy2rgb.m

husl2rgb.m

im2ods.m

im2spectrogram.m

imadjustFB.m

imblend.m

imcast.m

imcompare.m

imcompose.m

imdestroyer.m

imdrag.m

imecho.m

imgenerate.m

imlnc.m

immask.m

immodify.m

imrange.m

imshow2.m

imtweak.m

ismono.m

jpegger.m

jpegslur.m

lcdemu.m

lch2rgb.m

linedither.m

lineshifter.m

lingrad.m

maxchroma.m

meanlines.m

mergedown.m

mono.m

immodify.m

imrange.m

imshow2.m

imtweak.m

ismono.m

jpegger.m

jpegslur.m

lcdemu.m

lch2rgb.m

linedither.m

lineshifter.m

lingrad.m

maxchroma.m

meanlines.m

mergedown.m

mono.m

# rgb2hsy.m

Example 1:

Generate a test gradient to show color uniformity in HSY and HSYp compared to HSL. Although HSYp has restricted chroma, the results maintain the uniformity of the parent space. The low resolution of the gradient makes it easier to identify perceptual change as hue is varied. Compare to the HuSLp examples. Although not as uniform, HSYp has access to more saturated colors. In general, HSYp covers a greater fraction of its parent space than either HuSLp method.

steps=[40 20]; h=0:360/steps(1):(360-360/steps(1)); y=0:1/steps(2):(1-1/steps(2)); [H Y]=meshgrid(h,fliplr(y)); S=ones(size(Y)); hslrgb=colorspace('

Example 2:

Plot the volume enclosed by the range of HSYp as a subset of the projected RGB space in YPbPr

Lbreak=0.50195313; Cbreak=0.28211668; L=0:0.01:1; Cp=zeros(size(L)); mk=(L<Lbreak); Cp(mk)=Cbreak/Lbreak*L(mk); Cp(~mk)=Cbreak-Cbreak/(1-Lbreak)*(L(~mk)-Lbreak); stp=100; l=0:1/stp:1; h=0:360/stp:360; [L H]=meshgrid(l,h); st=size(Cp)-1; Lp=round(L*st(2))+1; C=Cp(Lp); X=C.*cos(H*pi/180); Y=C.*sin(H*pi/180); csview('ypbpr','invert',1,'alpha',0.5); surf(X,Y,L,'facecolor',[1 1 1])

Example 3:

Plot the upper and lower faces of the HuSLpab and HuSLpuv bicones and compare to HSYp.

no example code for this one, sorry.

addborder.m

arborddither.m

batchloader.m

bicoloradapt.m

blockify.m

cpicktool.m

colorpict.m

csview.m

cropborder.m

dilatemargins.m

displace.m

driftds.m

eoframe.m

eoline.m

findpixels.m

fourdee.m

gifread.m

arborddither.m

batchloader.m

bicoloradapt.m

blockify.m

cpicktool.m

colorpict.m

csview.m

cropborder.m

dilatemargins.m

displace.m

driftds.m

eoframe.m

eoline.m

findpixels.m

fourdee.m

gifread.m

gifwrite.m

glasstiles.m

hsi2rgb.m

hsy2rgb.m

husl2rgb.m

im2ods.m

im2spectrogram.m

imadjustFB.m

imblend.m

imcast.m

imcompare.m

imcompose.m

imdestroyer.m

imdrag.m

imecho.m

imgenerate.m

imlnc.m

glasstiles.m

hsi2rgb.m

hsy2rgb.m

husl2rgb.m

im2ods.m

im2spectrogram.m

imadjustFB.m

imblend.m

imcast.m

imcompare.m

imcompose.m

imdestroyer.m

imdrag.m

imecho.m

imgenerate.m

imlnc.m

immask.m

immodify.m

imrange.m

imshow2.m

imtweak.m

ismono.m

jpegger.m

jpegslur.m

lcdemu.m

lch2rgb.m

linedither.m

lineshifter.m

lingrad.m

maxchroma.m

meanlines.m

mergedown.m

mono.m

immodify.m

imrange.m

imshow2.m

imtweak.m

ismono.m

jpegger.m

jpegslur.m

lcdemu.m

lch2rgb.m

linedither.m

lineshifter.m

lingrad.m

maxchroma.m

meanlines.m

mergedown.m

mono.m

RGB2HSY() and HSY2RGB() can be used for conversion between RGB and my own version of HSY. This method uses a polar adaptation of YPbPr wherein the chroma is normalized and bounded by the extent of the RGB cube (a subset of the entire YPbPr space). Like HuSL, this minimizes the occurrence and severity of clipping. A point near the surface of the RGB cube will follow a noncircular path with hue rotation and a nonvertical path with Y scaling. Dramatic oversaturation merely pushes the point radially to the boundary of the RGB cube. In an unbounded method such as YPbPr or LCH, the point would be pushed far outside the RGB gamut and then when clipping occurs on return to RGB, it would be remapped to some point distant from its exit.

It's worth noting as well that in the output, H in HSY is aligned to the red corner of the RGB cube instead of to the PbPr plane. There would otherwise be a 108.6 degree offset between H in HSY and H in other models.

For examples of image manipulation with these methods, see IMBLEND() and IMTWEAK() pages.