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, TestImages | |
img = testimage("cameraman") | |
img = convert.(RGB{N0f8}, img) | |
open("cameraman.ppm", "w+") do io | |
println(io, "P6") | |
println(io, size(img, 2), " ", size(img, 1)) | |
println(io, 255) |
This file has been truncated, but you can view the full file.
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
P6 | |
512 512 | |
255 | |
œœœ ŸŸŸžžžœœœ›››œœœžžžœœœŸŸŸžžžžžžœœœžžžžžžŸŸŸŸŸŸ žžžžžž £££¢¢¢¢¢¢¢¢¢¢¢¢ ¡¡¡£££¡¡¡ ¢¢¢¦¦¦¤¤¤£££¡¡¡¡¡¡¢¢¢£££¡¡¡¡¡¡¢¢¢¤¤¤¥¥¥¦¦¦¤¤¤¢¢¢ ¢¢¢¥¥¥¥¥¥¥¥¥¤¤¤¥¥¥¥¥¥§§§¦¦¦¤¤¤£££¤¤¤¤¤¤¥¥¥¦¦¦§§§¦¦¦¥¥¥¥¥¥¥¥¥££££££¦¦¦ªªª¨¨¨¦¦¦¦¦¦§§§¦¦¦§§§¨¨¨ªªª©©©¨¨¨¨¨¨©©©§§§¦¦¦§§§©©©¨¨¨¦¦¦§§§ªªª©©©©©©¨¨¨©©©ªªª«««ªªª©©©ªªª¬¬¬ªªª©©©ªªª«««ªªª©©©¨¨¨©©©«««®®®®®®«««««««««®®®°°°¯¯¯®®®®®®°°°²²²´´´³³³³³³²²²²²²±±±²²²³³³¶¶¶µµµµµµµµµµµµ²²²°°°²²²¶¶¶³³³²²²²²²³³³³³³´´´´´´´´´´´´´´´²²²±±±µµµ¸¸¸¶¶¶µµµµµµ¶¶¶¶¶¶···¶¶¶¶¶¶¶¶¶···¶¶¶¶¶¶µµµ¶¶¶¶¶¶···¶¶¶¶¶¶···¹¹¹¸¸¸···µµµµµµ´´´µµµµµµ···¸¸¸¹¹¹·········¸¸¸·········¹¹¹¹¹¹ºººººº»»»¹¹¹¸¸¸¶¶¶¶¶¶¶¶¶¸¸¸¸¸¸ººº¹¹¹¹¹¹···¶¶¶¶¶¶···¸¸¸»»»¹¹¹¶¶¶¶¶¶¸¸¸¹¹¹»»»ººº¹¹¹ººº¼¼¼ººº¹¹¹¸¸¸¹¹¹ººº»»»¹¹¹¸¸¸···¸¸¸µµµµµµ···ººººººººººººººº¶¶¶´´´···»»»¹¹¹¶¶¶µµµµµµ···¹¹¹¸¸¸···µµµ³³³³³³µµµµµµ¶¶¶µµµµµµ···¹¹¹···¶¶¶¸¸¸ººº¸¸¸¶¶¶µµµµµµ¶¶¶···¶¶¶¶¶¶µµµµµµµµµ¶¶¶µµµ´´´³³³³³³´´´¶¶¶³³³±±±²²²´´´´´´µµµ³³³²²²±±±²²²³³³´´´³³³³³³³³³´´´²²²±±±±±±²²²³³³µµµ´´´²²²°°°°°°±±±²²²¯¯¯®®®¯¯¯±±±²²²²²²¯¯¯ |
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
# ]add https://github.com/IanButterworth/VideoInTerminal.jl | |
# ]add ImageCore | |
# ]add ColorSchemes | |
using VideoInTerminal | |
using ImageCore | |
using ColorSchemes | |
""" | |
Count number of Mandelbrot iterations until `threshold` is crossed, | |
up to a maximum of `maxits`. |
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
# ]add https://github.com/IanButterworth/VideoInTerminal.jl | |
# ]add ImageCore | |
using VideoInTerminal | |
using ImageCore | |
""" | |
Run n Mandelbrot iterations. | |
""" | |
function mb_iterations(c::AbstractArray{T}; n=50) where {T<:Complex} | |
z = zeros(T, size(c)) |