The RGBcolor model is an additivecolor model in which red,green,and blue light areadded together in various waysto reproduce abroad array o f colors.The name o f the modelcomesfromtheinitialsofthethreeadditiveprimarycolors,red,green,andblue.
The main purpose o f the RGB color model is for the sensing,representation, and display o fimages in electronic systems,such as televisions and computers,though it has also been used inconventional photography.Beforethe electronic age,the RGBcolor model already had a solidtheorybehindit,basedinhumanperceptionofcolors. RGB is a device-dependent color model: different devices detect or reproduce a given RGBvalue differently,since the color elements (such as phosphors or dyes) and their response to theindividual R,G,and Вlevelsvary frommanufacturerto manufacturer,oreveninthesamedevice over time.Thus an RGB value does not define the same color across devices without somekindofcolormanagement.
Typical RGB input devices are colorTV and video cameras,image scanners,video games,and digital cameras.Typical RGBoutput devicesareTV setso f varioustechnologies(CRT,LCD,plasma,OLED,Ouantum-Dotsetc.),computerandmobilephonedisplays,videoprojectors,multicolor LEDdisplays,and largescreens suchas JumboTron.Color printers,ontheotherhand,arenotRGBdevices,butsubtractivecolordevices(typicallyCMYKcolormodel).
*(8. BarBaraZukinHeiman. PH.D. and others Practical PhotoshopCS6, Level lCopyright€> 2009-2012by.53pg.) RangningCM modeli
Ushbu model ranglaming yutilish (ayirish) primjipini amalga oshiriladigan qurilmalarda tasvir hosil qilishda rangni ifodalash uchun qo’llaniladi. Bu prinipp eng avvalo qog’ozga pechat qiluvchi qurilmalarda qo’llaniladi. Ushbu modelning atalishi asosiy subtraktiv ranglar - havorang( ) qirmizi (Madenta) va sariq ( ) ranglar nomidan tuzilgan.
M tizimining asosiy ranglari va ulaming qo’shilishi
Oq qog’ozga sariq bo’yoqning surtilishi qaytgan ko’k numing yutilishini bildiradi. Havorang bo’yoq qizil nurni, qirmizi bo’yoq - yashil rangni yutadi. Bo’yoqlar kombinaipyasi yashil, qizil, ko’k, va qora ranglarning qoplanishini ta’minlaydi .
Amalda, bo’yoqlarning ideal emasligi bilan bog’liq holda, qora rangni ranglarni aralashtirish bilan hosil qilish qiyin, shuning uchun printerlarda yana qora rang (black) ham ishlatiladi. Unda model MV deb ataladi.
SHuni ham ta’kidlash lozimki, har qanday bo’yoq ham yuqorida ko’rsatilgan Mranglari ayirmasini ta’minlayvermaydi. Bu haqida quyida to’laroq keltirilgan.
Quydagi jadvalda R( В va M modellaridagi ba’zi ranglar keltirilgan
Rang
RGB modeli
M modeli
R
в
C
M
Qizil
1
0
0
0
1
1
Sariq
1
1
0
0
0
1
To’q yashil
0
1
0
1
0
1
Havorang
0
1
1
1
0
0
Ko’k
0
0
1
1
1
0
Qirmizi
1
0
1
0
1
0
Qora
0
0
0
1
1
1
Oq
1
1
1
0
0
0
To forma color with RGB,three light beams (one red,one green,and onebine) must besuperimposed(forexamplebyemissionfromablackscreen,orbyreflectionfromawhitescreen).Each o f the three beams is called a component o f that color,and each o f them can haveanarbitraryintensity,fromfullyofftofullyon,inthemixture.
The RGB color model is additive in the sensethat the three light beams are added together,andtheirlightspectraadd,wavelengthforwavelength,tomakethefinalcolor'sspectrum.
Zero intensity for each component givesthe darkest color(no light,considered theblack),and full intensity o f each gives a white;the quality o f this white depends on the natureo f theprimarylight sources,buti f theyare properlybalanced,theresultisaneutral whitematchingthe system's white point.When the intensities for all the components are the same,the result is ashade o fgray, darker or lighter depending on the intensity.When the intensities are different, theresult is a colorized hue,more or less saturated depending on the difference o f the strongest andweakest oftheintensitiesoftheprimarycolorsemployed.
When one o f the components has the strongest intensity,the color is a hue near this primarycolor (reddish, greenish,or bluish), and when two components have the same strongest intensity,then the color is a hue o f a secondary color (a shade o f cyan,magenta or yellow). A secondarycolor is formed by the sum o f two primary colors o f equal intensity: cyan is green+blue,magentais red+blue,and yellowis redgreen.Every secondary color is the complement o f one primarycolor; when a primary and its complementary secondary color are added together,the result iswhite:cyancomplementsred,magentacomplementsgreen,andyellowcomplementsblue.
RGB modelida mavjud bo’lagn manfiy koeffiiqentlar muammosini hal etish uchun Xalqaro Yoritish Komissiya (СГЕ) tomonidan XYZ kolorimetriya tizimi qabul qilindi. XYOK XYZ tizimida asosiy ranglar sifatida yana uch rang qabul qilindi, ammo bular shartli, real bo’lmagan ranglardir.
YUqorida ко’rib chiqilgan rang modellari u yoki bu tarzda ba’zi asosiy ranglarning qo’shilishidan foydalanadi. Endi esa ulardan boshqacha, alternativ tipga qo’shsa bo’ladigan rang modelini ко’rib chiqamiz.
HSV modelida rang ton N (hue), to’yinganlik S (saturation), yorqinlik yoritilganlik V (value) bilan ifodalanadi. N ning qiymati 0 dan 360 gacha bo’lgan graduslarda o’lchanadi, chunki bu erda kamalak ranglari aylana bo’yicha quyidagi tartibda joylashtiriladi: qizil, zarg’aldoq, sariq, yashil, havorang, ko’k, binafsha. S va V ning qiymati (0... 1) sohada aniqlanadi.
Aylana bo’yicha bir - birlarining ro’parasida joylashgan, ya’ni bir - birlaridan N bo’yicha 180^ ga farq qiluvchi ranglar bir - birlariga qo’shimcha ranglardir. Rangni HSV parametrlari orqali berish grafik tizimlarda tez-tez uchrab turadi, shu bilan birga odatda konus ochilgan holda ko’rsatiladi.
HSV ga o’xshash qurilgan boshqa rang modellari ham mavjud, masalan, HLS (Hue, Lighting, Saturation) modeli ham rang konusidan foydalanadi.
Sanab o’tilgan barcha rang modellari rangni uch parametr bilan bayon etadi. Ular ranglarni ancha keng sohalarda ifodalaydi. Endi esa rang bir son bilan, ammo ranglarning (nozik turlarning) chegaralangan sohasi uchun, beriladigan modelni ko’rib chiqamiz.
Amaliyotda oq-qora (kulrang) yarim tonli tasvirlardan tez-tez foydalaniladi. Kulrang ranglar RC В modelida bir xil tashkil etuvchilar,
ya’ni ri=gi=bi bilan ifodalanadi. SHunday qilib, kulrang tasvirlar uchun uchta sondan foydalanishga zarurat yo’q, birgina sonning o’zi etarli. Bu rang modelini qisqrtirish imkonini beradi. Har bir gradusda yorqinlik El bilan aniqlanadi. E1=0 qora rangga, El ning maksimal qiymati - oq rangga to’g’ri keladi.
Misol tariqasida RC В tizimda berilgan rangli tasvirni kulrang gradauiyadagiga aylantirishni ko’rib chiqamiz (xuddi oq - qora ekranli televizorda rangli filmni ko’rsatish o’xshash holat). Buning uchun quyidagi nisbatan foydalanish mumkin:
U=0,299R+0,587G+0,114B,
bu erda R, va В lar koeffmientlar odamning mos ravishdagi ranglarga turlicha sezgirligini, va, undan tashqari, ularning yig’indisi birga teng ekanligini hisobga oladi. O’z-o’zidan ma’lumki,
teskari almashtirish bo’lmish R=Y,G=Y,B=Y kulranglar gradauiyasidan boshqa natija bermaydi.
Turli rang modellaridan foydalanishga yana bir misol keltiramiz. Rangli fotografiyalarni JPEG formatidagi grafikaviy faylga yozishda R( В modelidan (Y, Co, Cr) modeliga almashtirish amalga oshiriladi. Bu rastr tasviridagi axborot hajmini yanada siqish uchun foydalaniladi. JPEG fayllarini o’qishda qaytadan RGB ga almashtirish bajariladi.
Modellarning turli-tumanligi ulardan turli sohalarda foydalanish bilan bog’liq. Rang modellaridan har biri tasvimi kiritish, uni ekranda ko’rinadigan holatga keltirish (vizualizauiya), qog’ozga pechat qilish, tasvir ustida ishlash, fayllarda saqlash, kolorimetrik hisob-kitoblar va o’lchovlar kabi ayrim operauiyalarni samaraliroq bajarish uchun ishlab chiqilgandir.
Bir modelning boshqasiga almashtirilishi tasvirdagi ranglarning buzilishiga olib kelishi mumkin.