Image:Barn grand tetons rgb separation.jpg
From Wikipedia, the free encyclopedia
Size of this preview: 200 × 598 pixels
Full resolution (1,600 × 4,780 pixels, file size: 1.03 MB, MIME type: image/jpeg)
[edit] Summary
This takes an image (Image:Barns grand tetons.jpg) and displays the red, green and blue elements extracted from it.
Note that the white snow is composed of strong red, green and blue; the brown barn is composed of strong red and green with little blue; the dark green grass is composed of strong green with little red or blue; and the light blue sky is composed of strong blue and moderately strong red and green.
[edit] Generator code
In MATLAB:
RGBimage = imread('barns_grand_tetons.jpg');
[height,width,depth]=size(RGBimage);
% Newer versions of matlab need outputimage=zeros(height*4,width,depth,'uint8');
outputimage=uint8(zeros(height*4,width,depth));
for w=1:width,
for h=1:height,
outputimage(h,w,1) = RGBimage(h,w,1); %Copy R, G and B for normal image
outputimage(h,w,2) = RGBimage(h,w,2);
outputimage(h,w,3) = RGBimage(h,w,3);
outputimage(h+height,w,1) = RGBimage(h,w,1); %Copy R only for first component
outputimage(h+(2*height),w,2) = RGBimage(h,w,2); %G only for second component
outputimage(h+(3*height),w,3) = RGBimage(h,w,3); %B only for third component
end
end
image(outputimage);
imwrite(outputimage,'rgb_separation.jpg','jpeg');
[edit] Licensing
Based on the (public domain) photo Image:Barns grand tetons.jpg. Code above and resulting output by Mike1024.
| This work has been released into the public domain by the copyright holder. This applies worldwide. In case this is not legally possible: |
File history
Click on a date/time to view the file as it appeared at that time.
| Date/Time | Dimensions | User | Comment | |
|---|---|---|---|---|
| current | 12:33, 2 June 2006 | 1,600×4,780 (1.03 MB) | Mike1024 (Talk | contribs) | (==Summary== This takes an image (Image:Barns grand tetons.jpg) and displays the red, green and blue elements extracted from it. Note that the white snow is comprised of strong red, green and blue; the brown barn is compr) |
- Search for duplicate files
- Edit this file using an external application
See the setup instructions for more information.
File links
The following files are duplicates of this file:
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):

