  # Julia Fractal in Python Equation for generating Julia`s fractal: where c — complex parameter. Julia`s set for this system is a subset of the complex plane, defined as: So, let`s now try to create one of the fractals in the image above.

For this we need the Python module Pillow, which makes it easier to work with images and so on.

To install a pillow via pip, enter the following command at the command line.

` pip install Pillow `

Now use this library to create a fractal image.

Output:

 ` # Python code for Julia Fractal ` ` from ` ` PIL ` ` import ` ` Image `   ` # dra function ivera ` ` if ` ` __ name__ ` ` = = "__ main__" : ``   # adjust width, height and scale # image to be generated w, h, zoom = 1920 , 1080 , 1   # create a new RGB image   bitmap   = Image.new ( "RGB" , (w, h), " white " )   # Allocate storage for the image and # load pixel data. pix = bitmap.load ()   # installation variables according to # equation for creating a fractal cX, cY =   - 0.7 , 0.27015 moveX, moveY = 0.0 , 0.0 maxIter = 255   for x in range (w ): for y in range (h):  zx = 1.5 * (x - w / 2 ) / ( 0.5 * zoom * w) + moveX zy = 1.0 * (y - h / 2 ) / ( 0.5 * zoom * h) + moveY i = maxIter   while zx * zx + zy * zy & lt;  4 and i & gt;  1 : tmp = zx * zx - zy * zy + cX zy, zx = 2.0 * zx * zy + cY, tmp i - = 1     # convert byte to RGB (3 bytes) like   # magic to get nice colors pix [ x, y] = (i & lt; & lt;  21 ) + (i & lt; & lt; 10 ) + i * 8   # to display the created fractal bitmap.show () `