Last active
September 10, 2022 10:32
-
-
Save niklasschmitz/03be29c2850ac3bbdf6ce86229b71d8f to your computer and use it in GitHub Desktop.
Testimage camera.ppm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Images | |
# CC0 license: https://commons.wikimedia.org/wiki/File:Wikicommons_kamera_rollei35_rrt877.jpg | |
file = download("https://upload.wikimedia.org/wikipedia/commons/thumb/3/38/Wikicommons_kamera_rollei35_rrt877.jpg/640px-Wikicommons_kamera_rollei35_rrt877.jpg") | |
img = load(file) | |
open("camera.ppm", "w+") do io | |
println(io, "P6") | |
println(io, size(img, 2), " ", size(img, 1)) | |
println(io, 255) | |
for row in eachrow(img) | |
for px in row | |
write(io, px.r.i) | |
write(io, px.g.i) | |
write(io, px.b.i) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment