Skip to content

Instantly share code, notes, and snippets.

@25b3nk
Last active May 28, 2021 16:24
Show Gist options
  • Save 25b3nk/b9642c2fefd129c76834808523a91174 to your computer and use it in GitHub Desktop.
Save 25b3nk/b9642c2fefd129c76834808523a91174 to your computer and use it in GitHub Desktop.
Create animated optical illusion in GIMP

Steps to create animated optical illusion in GIMP

Step 1

Create a new file of width: 960px and height: 600px, background color as white.

Step 2

Create a new layer and draw a solid circle (frame 1), then duplicate it to next layer and move the circle right by 40 pixels. Repeat till you have 6 frames (frame 1 to frame 6). These frames are our subjects.

Step 3

Create a new file of width: 6px and height: 600px, create new layer and delete the background layer, as we need the layer to be transparent. Then create a fixed rectangle of width 5px and height: 600px. Refer to this site to get an idea of how to set the size and position for the rectangle.

Step 4

Save the single bar and create new layer in the main project. Here name it as bars, and add the saved single bar image, and copy paste till you fill the whole width of 960px. (Frame name: bars)

Step 5

Select the transparent area of the bars, refer to this site to understand how. Then invert the selection, by clicking Ctrl+I.

Step 6

Now we delete all the subject frames except frame 1. (How: You can click on the layer you want to delete and press Delete)

Step 7

Unselect the selection by clicking Shift+Ctrl+A. Now move the bars frame by one pixel to the right. (How: Select the move tool and click on the bars, and then click on right arrow once)

Step 8

Repeat steps 5 through 7, and every time don't delete one of the subject frames. We first do not delete frame 1, next it will be frame2. Repeat the process till you have reached to stage of not deleting frame 6, after which we are done.

Step 9

The magic is ready, we unselect everything and move the bars pixel by pixel towards right or left and see the animation!!

Reference

  1. YouTube video to create animated illusion in Photoshop

Final output

Output GIF

This is how final subject frames look together

Final subject frames

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment