lg = ph.gradient.linear([pal[0], pal[1]], [1, 0], theta=np.pi / 2) C += circle(0, 0, radius - 2 * offset, thickness=tc / 2, gradient=lg) lg = ph.gradient.linear([pal[2], pal[1]], [1, 0], theta=-np.pi / 2) C += circle(0, 0, radius - offset, thickness=tc / 2, gradient=lg) lg = ph.gradient.linear([pal[2], pal[1]], [1, 0], theta=np.pi / 2) C += circle(0, 0, radius + 1.5 * offset, thickness=tc / 2, gradient=lg) # Start a new canvas and load in an image. It will resize automatically. C = Canvas().load("asphalt-dark-dawn-531321.jpg") # Apply the instagram-like filter named 1977. # Use ph.filters.instafilter("") to get a list of all known. C += ph.filters.instafilter("1977") # Start a new layer. This uses the current image as a background, and then # applies it after the context is over. with C.layer() as layer: # Draw the circles, blend, then draw them again. # This makes them have a glowy effect. draw_circles(layer) layer += ph.filters.gaussian_blur() draw_circles(layer) C.save("figures/blue_woods.png") C.show()
base_r = 0.80 r = base_r + dx lg = linear_gradient(pal[0], pal[1], theta=np.pi / 2) C += ellipse(0, 0, r, r, thickness=tc, gradient=lg) r = base_r - 2 * dx lg = linear_gradient(pal[0], pal[1], theta=-np.pi / 2) C += ellipse(0, 0, r, r, thickness=tc / 2, gradient=lg) r = base_r - dx lg = linear_gradient(pal[2], pal[1], theta=np.pi / 2) C += ellipse(0, 0, r, r, thickness=tc / 2, gradient=lg) r = base_r + 1.5 * dx lg = linear_gradient(pal[2], pal[1], theta=-np.pi / 2) C += ellipse(0, 0, r, r, thickness=tc / 2, gradient=lg) C = Canvas().load("asphalt-dark-dawn-531321.jpg") C += instafilter("1977") with C.layer() as C2: draw_circles(C2) C2 += gaussian_blur() draw_circles(C2) C.save("blue_woods.png") C.show()