RosettaCodeData/Task/Bitmap-Write-a-PPM-file/Julia/bitmap-write-a-ppm-file-1.julia
2015-11-18 06:14:39 +00:00

15 lines
292 B
Text

using Color, Images, FixedPointNumbers
w = 70
h = 50
a = zeros(RGB{Ufixed8}, h, w)
img = Image(a)
img["x", 10:40, "y", 5:35] = color("skyblue")
for i in 45:65, j in (i-25):40
img["x", i, "y", j] = color("sienna1")
end
imwrite(img, "bitmap_write.ppm")
imwrite(img, "bitmap_write.png")