From: Markus Schirp Date: 2010-03-29T02:56:18+09:00 Subject: Re: divide BMP to YUV channels Hello, I dont think the ruby-ml, or the ruby-forums, are an exersise solving machine... But i can give you the following overall picture of your programm (more pseudocode than ruby) ==== BEGIN image = open_source_image y_image = open_new_image u_image = open_new_image v_image = open_new_image for pixel_in_image in image do y,u,v = calculate_yuv_for_pixel(pixel) write_to_image(y_image,y) write_to_image(u_image,u) write_to_image(v_image,v) end ==== END greetings, Markus On Mon, Mar 29, 2010 at 01:02:25AM +0900, Pearce Pearce wrote: > Hey guys! > I have an univercity exersise: > I'm trying to get YUV channels from BMP picture, and output it like 3 > grey images. > I know the proportion: > RGB to YUV > Y = (0.257 * R) + (0.504 * G) + (0.098 * B) + 16 > V = (0.439 * R) - (0.368 * G) - (0.071 * B) + 128 > U = -(0.148 * R) - (0.291 * G) + (0.439 * B) + 128 > > But don't know how to get it works with Ruby. > > Thanks in advance! > -- > Posted via http://www.ruby-forum.com/.