File:3-bit grayscale.gif

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

3-bit_grayscale.gif (400 × 400 pixels, file size: 223 KB, MIME type: image/gif, looped, 180 frames, 7.2 s)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
English:
import numpy as np

import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from mpl_toolkits.mplot3d import Axes3D

bits=3
fig = plt.figure()
fig.subplots_adjust(left=0, bottom=0, right=1, top=1)
ax = fig.add_subplot(111, projection='3d')
ax.set_axis_bgcolor((0.5, 0.5, 0.5))
gradient = np.linspace(0, 1, 2**bits)
colors=np.stack((gradient.flatten(),gradient.flatten(),gradient.flatten()),axis=1)
ax.scatter(gradient,np.ones(2**bits),np.ones(2**bits),alpha=1.0,s=100./2**bits,c=colors,marker='o',linewidth='0')

def update(i):
    ax.view_init(elev=20., azim=i)
    return fig, ax

if __name__ == '__main__':
    plt.axis('off')
    fig.set_size_inches(5, 5)
    anim = FuncAnimation(fig, update, frames=np.arange(0, 360, 2), repeat=True)
    anim.save('%d-bit_grayscale.gif' % bits, dpi=80, writer='imagemagick', fps=24)
Date
Source Own work
Author Kjerish
Other versions

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International 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/TimeThumbnailDimensionsUserComment
current13:55, 9 January 2017Thumbnail for version as of 13:55, 9 January 2017400 × 400 (223 KB)Kjerish (talk | contribs)User created page with UploadWizard

File usage on other wikis

The following other wikis use this file: