diff --git a/README.md b/README.md index acb8cd9..350a1c1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ - -![Fractal](out.png "Fractal") +![Mandelbrot fractal](mandelbrot.png "Fractal") Requires @@ -8,9 +7,9 @@ Requires ### How to run -```sh -$ cabal install JuicyPixels -$ ghc main.hs -$ ./main +```shell +cabal update +cabal install --lib JuicyPixels +ghc -Wall -Werror main.hs +./main ``` - diff --git a/fractal.pgm b/mandelbrot.pgm similarity index 100% rename from fractal.pgm rename to mandelbrot.pgm diff --git a/out.png b/mandelbrot.png similarity index 100% rename from out.png rename to mandelbrot.png diff --git a/mandelbrot2pgm b/mandelbrot2pgm new file mode 100755 index 0000000..e33e22a Binary files /dev/null and b/mandelbrot2pgm differ diff --git a/pgm.hs b/mandelbrot2pgm.hs similarity index 96% rename from pgm.hs rename to mandelbrot2pgm.hs index 1e928e2..725a7d8 100644 --- a/pgm.hs +++ b/mandelbrot2pgm.hs @@ -75,4 +75,4 @@ frac c z iter -- The file output pgmHeader :: C.ByteString pgmHeader = C.pack ("P5\n" ++ (show width) ++ " " ++ (show height) ++ "\n255\n") -main = C.writeFile "fractal.pgm" (C.append pgmHeader (C.concat [(row y) | y <- yList])) +main = C.writeFile "mandelbrot.pgm" (C.append pgmHeader (C.concat [(row y) | y <- yList])) diff --git a/mandelbrot2png b/mandelbrot2png new file mode 100755 index 0000000..a14420d Binary files /dev/null and b/mandelbrot2png differ diff --git a/main.hs b/mandelbrot2png.hs similarity index 94% rename from main.hs rename to mandelbrot2png.hs index 9c8526f..b9f66ca 100644 --- a/main.hs +++ b/mandelbrot2png.hs @@ -36,5 +36,5 @@ render xi yi = grayify . realize $ fractal (x :+ y) (0 :+ 0) 0 sharpen v = 1 - exp (-exp ((v - 0.92) / 0.031)) main :: IO () -main = writePng "out.png" $ generateImage render width height +main = writePng "mandelbrot.png" $ generateImage render width height