Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #@gui Colour Space Conversion: csconvert, csconvert_preview()
- #@gui : To RGB from = choice("RGB","sRGB","CMYK","CMY","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","Lab8","Lab","YCbCr","YCbCr_2","YIQ8","YIQ","YUV8","YUV","Bayer","HCY","XYZ8","XYZ")
- #@gui : Multiply = float(1,-10,10)
- #@gui : Add = int(0,-256,256)
- #@gui : From RGB to = choice("RGB","sRGB","CMYK","CMY","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","Lab8","Lab","YCbCr","YCbCr_2","YIQ8","YIQ","YUV8","YUV","Bayer","HCY","XYZ8","XYZ")
- csconvert:
- repeat $! l[$>] split_opacity l[0] to_rgb
- cs=$1
- sc=$4
- if {$cs==1} srgb2rgb
- elif {$cs==2} cmyk2rgb
- elif {$cs==3} cmy2rgb
- elif {$cs==4} hsv82rgb
- elif {$cs==5} hsv2rgb
- elif {$cs==6} hsl82rgb
- elif {$cs==7} hsl2rgb
- elif {$cs==8} hsi82rgb
- elif {$cs==9} hsi2rgb
- elif {$cs==10} lch82rgb
- elif {$cs==11} lch2rgb
- elif {$cs==12} lab82rgb
- elif {$cs==13} ycbcr2rgb
- elif {$cs==14} ycbcr_22rgb
- elif {$cs==15} yiq82rgb
- elif {$cs==16} yiq2rgb
- elif {$cs==17} yuv82rgb
- elif {$cs==18} yuv2rgb
- elif {$cs==19} bayer2rgb 0,0,0
- elif {$cs==20} hcy2rgb
- elif {$cs==21} xyz82rgb
- elif {$cs==22} xyz2rgb
- fi
- f "(i*$2)+$3"
- if {$sc==1} rgb2srgb
- elif {$sc==2} rgb2cmyk
- elif {$sc==3} rgb2cmy
- elif {$sc==4} rgb2hsv8
- elif {$sc==5} rgb2hsv
- elif {$sc==6} rgb2hsl8
- elif {$sc==7} rgb2hsl
- elif {$sc==8} rgb2hsi8
- elif {$sc==9} rgb2hsi
- elif {$sc==10} rgb2lch8
- elif {$sc==11} rgb2lch
- elif {$sc==12} rgb2lab8
- elif {$sc==13} rgb2ycbcr
- elif {$sc==14} rgb2ycbcr_2
- elif {$sc==15} rgb2yiq8
- elif {$sc==16} rgb2yiq
- elif {$sc==17} rgb2yuv8
- elif {$sc==18} rgb2yuv
- elif {$sc==19} rgb2bayer 0
- elif {$sc==20} rgb2hcy
- elif {$sc==21} rgb2xyz8
- elif {$cs==22} rgb2xyz
- fi
- to_rgb endl a c endl done
- csconvert_preview :
- csconvert $*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement