g = red(img)*M_RGB_Y[1] + green(img)*M_RGB_Y[2] + blue(img)*M_RGB_Y[3]
save("data/bitmapOutputTest.ppm", greyimg)</lang>
g = clamp(g, 0.0, 1.0)
return grayim(g)
end
ima = imread("bitmap_read_ppm_in.ppm")
imb = convert(Image{Gray{Ufixed8}}, ima)
imwrite(imb, "bitmap_read_ppm_out.png")
</lang>
{{out}}
[https://raw.githubusercontent.com/MichaeLeroy/rosetta-code/master/julia/support/color_chips.png Input] and [https://raw.githubusercontent.com/MichaeLeroy/rosetta-code/master/julia/completed/bitmap_read_ppm_out.png output] images in <tt>PNG</tt> format. The <tt>PPM</tt> input file was created using a variant of the Julia PPM/Write [https://github.com/MichaeLeroy/rosetta-code/blob/master/julia/support/color_chips.jl solution] to provide something reasonably colorful.