File:Rolling shutter effect animation.gif
Tools
Actions
General
Print/export
In other projects
Appearance
From Wikimedia Commons, the free media repository
Rolling_shutter_effect_animation.gif (400 × 200 pixels, file size: 139 KB, MIME type: image/gif, looped, 60 frames, 6.0 s)
File information
Structured data
Captions
Captions
Add a one-line explanation of what this file represents
Summary
[edit]DescriptionRolling shutter effect animation.gif |
English: The effect of a rolling shutter on a spinning disc simulated. The jagged appearance is due to the small number of rows; the higher number of rows in a real camera results in smoother curves. |
|
Date | ||
Source |
|
|
Author | cmglee |
Python source
[edit]The frames were rendered using Python 2 with pypng below, converted to GIF, made into a GIF animation, and optimised with Ezgif.
#!/usr/bin/env python
import png, math, os, functools, operator
def draw_pixel(pixelsss, x, y, rrggbb):
pixelsss[y][x][0] = int(rrggbb[-6:-4], 16)
pixelsss[y][x][1] = int(rrggbb[-4:-2], 16)
pixelsss[y][x][2] = int(rrggbb[-2: ], 16)
def write_png(path, pixelsss, width, height=None, alpha=False):
print('> %s' % (path))
f_out = png.Writer(width=width, height=width if height is None else height, alpha=alpha)
return f_out.write_array(open(path, 'wb'),
functools.reduce(operator.iconcat,
functools.reduce(operator.iconcat, pixelsss, []), []))
def compute_colour(fraction, deg):
return colours[int((deg + 720 - 360 * fraction + 0.5) / 60) % 6]
n_frame = 60
w_frame = 400
h_frame = 200
radius = 99
w_frame2 = w_frame // 2
diameter = radius * 2
colours = ['ff0000','cc9900','00cc00','3399ff','6666ff','cc33ff']
basename = os.path.splitext(os.path.basename(__file__))[0]
cumulsss = [[[255 for c in range(3)] for x in range(diameter)]
for y in range(diameter)]
for i_frame in range(n_frame + 1): ## 0 = prepare cumulative image
framesss = [[[255 for c in range(3)] for x in range(w_frame)]
for y in range(h_frame)]
for y in range(-radius, radius):
out_y = y + radius
out_y_end = (diameter - 1) * i_frame // n_frame
for x in range(-radius, radius):
if x * x + y * y < radius * radius:
out_x = x + radius
deg = math.degrees(math.atan2(y, x))
colour_cumul = compute_colour((y + radius + 1.0) / (diameter - 1), deg)
colour_disc = compute_colour(float(i_frame) / n_frame , deg)
if i_frame > 0: draw_pixel(framesss, out_x + 1, out_y, colour_disc )
else: draw_pixel(cumulsss, out_x , out_y, colour_cumul)
if out_y <= out_y_end: framesss[out_y][w_frame2:w_frame2 + diameter] = cumulsss[out_y]
for dy in [-1, 0]:
framesss[out_y_end + dy][1] = framesss[out_y_end + dy][w_frame - 2] = [0,0,0]
for dy in [-2, 1]:
framesss[out_y_end + dy][1:w_frame - 1] = [[0,0,0] for i in range(w_frame - 2)]
if i_frame > 0:
write_png(r'F:\%s\%02d.png' % (basename, i_frame), framesss, w_frame, h_frame)
else:
write_png(r'F:\%s\00.png' % (basename), cumulsss, diameter, diameter)
Licensing
[edit]


This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 02:28, 23 May 2025 | ![]() | 400 × 200 (139 KB) | Cmglee (talk | contribs) | Increase framerate to 10 fps |
02:04, 23 May 2025 | ![]() | 400 × 200 (56 KB) | Cmglee (talk | contribs) | Calculate every row in Python with png.py to reduce jaggies | |
17:34, 16 October 2013 | ![]() | 400 × 200 (109 KB) | Cmglee (talk | contribs) | User created page with UploadWizard |
You cannot overwrite this file.
File usage on Commons
The following 2 pages use this file:
File usage on other wikis
The following other wikis use this file:
- Usage on ca.wikipedia.org
- Usage on de.wikipedia.org
- Usage on en.wikipedia.org
- Usage on fa.wikipedia.org
- Usage on fr.wikipedia.org
- Usage on fr.wikibooks.org
- Usage on ru.wikipedia.org
- Usage on uk.wikipedia.org
- Usage on zh.wikipedia.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
GIF file comment | GIF compressed with https://ezgif.com/optimize |
---|