Popular recipes tagged "graphics" but not "math"http://code.activestate.com/recipes/tags/graphics-math/2016-09-25T21:24:12-07:00ActiveState Code RecipesImage to ASCII Art Converter (Python) 2016-09-25T21:24:12-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/580702-image-to-ascii-art-converter/ <p style="color: grey"> Python recipe 580702 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/image/">image</a>, <a href="/recipes/tags/images/">images</a>, <a href="/recipes/tags/pil/">pil</a>). </p> <p>ASCII Art Generator (Image to ASCII Art Converter)</p> <p>Input file maybe JPG, PNG, GIF etc. Output file name maybe output.txt etc.</p> ASCII art Sphere with integer square root (Batch) 2016-06-06T10:09:38-07:00Antoni Gualhttp://code.activestate.com/recipes/users/4182514/http://code.activestate.com/recipes/580673-ascii-art-sphere-with-integer-square-root/ <p style="color: grey"> Batch recipe 580673 by <a href="/recipes/users/4182514/">Antoni Gual</a> (<a href="/recipes/tags/ascii/">ascii</a>, <a href="/recipes/tags/graphics/">graphics</a>). Revision 2. </p> <p>The code draws a sphere in ASCII Art. Square root routine bt Aacini</p> Simple drawing tool with Python turtle graphics (Python) 2016-01-27T22:22:01-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580544-simple-drawing-tool-with-python-turtle-graphics/ <p style="color: grey"> Python recipe 580544 by <a href="/recipes/users/4173351/">Vasudev Ram</a> (<a href="/recipes/tags/drawing/">drawing</a>, <a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/python2/">python2</a>, <a href="/recipes/tags/tkinter/">tkinter</a>, <a href="/recipes/tags/turtle/">turtle</a>). </p> <p>A simple drawing program that lets you use your keyboard to draw figures on screen, using the turtle graphics module built into Python.</p> Mandelbrot Set made simple (Python) 2015-12-28T17:56:08-08:00Jack Trainorhttp://code.activestate.com/recipes/users/4076953/http://code.activestate.com/recipes/579143-mandelbrot-set-made-simple/ <p style="color: grey"> Python recipe 579143 by <a href="/recipes/users/4076953/">Jack Trainor</a> (<a href="/recipes/tags/educational/">educational</a>, <a href="/recipes/tags/fractal/">fractal</a>, <a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/mandelbrot/">mandelbrot</a>, <a href="/recipes/tags/mathematics/">mathematics</a>). Revision 2. </p> <p>This is a mini-framework for exploring the Mandelbrot Set.</p> <p>It outputs to a Tkinter window or to a PNG file (Pillow package required). It includes a disk caching mechanism for saving and later retrieving Mandelbrot calculations to avoid recalculating the Set on each run.</p> <p>See module documentation for further information. Compatible with Python 2 and 3.</p> Python Mandelbrot Fractal with Tkinter (Python) 2015-05-06T09:57:27-07:00Antoni Gualhttp://code.activestate.com/recipes/users/4182514/http://code.activestate.com/recipes/579048-python-mandelbrot-fractal-with-tkinter/ <p style="color: grey"> Python recipe 579048 by <a href="/recipes/users/4182514/">Antoni Gual</a> (<a href="/recipes/tags/fractal/">fractal</a>, <a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). Revision 9. </p> <p>Displays in a Tk window a pretty coloured 640x480 Mandelbrot set in 6 seconds. Calculates each one of the 300K pixels with a maximum of 256 iterations. <br> Only Tkinter used. Tested with Python 3.4 <br> I will test any contribution and add it to the code if worthy.</p> Animated raster graphics demo in Tkinter (Python) 2015-05-05T20:26:41-07:00Antoni Gualhttp://code.activestate.com/recipes/users/4182514/http://code.activestate.com/recipes/579052-animated-raster-graphics-demo-in-tkinter/ <p style="color: grey"> Python recipe 579052 by <a href="/recipes/users/4182514/">Antoni Gual</a> (<a href="/recipes/tags/animation/">animation</a>, <a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). Revision 4. </p> <p>EDITED: A small animated graphics demo in Tkinter, displaying a 1990's style Rotozoom, more interesting than the TV snow I posted previously. The Tkinter management part is just the same. The code is a little longer as some trig tables must be precalculated for speed. The window size corresponds to the resolution of the old DOS screen 13, as I originally coded the demo for Qbasic. </p> Simple Text Mode Digital Oscilloscope Graphics DEMO. (Python) 2014-01-21T19:07:49-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578812-simple-text-mode-digital-oscilloscope-graphics-dem/ <p style="color: grey"> Python recipe 578812 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>). </p> <p>This is a DEMO to switch a *NIX terminal from text to _graphics_ mode on the fly.</p> <p>The graphics characters are limited to lowercase 'a' through 'z' and this DEMO just prints a small subset to see what a fun, kids level, 8 channel Logic-Analyser/Digital-Oscilloscope might look like.</p> <p>This may not work in every *NIX style terminal but does work on default terminals using bash on OSX 10.7.5, PCLinuxOS 2009 and Debian Linux 6.0.x.</p> <p>Tested on Python 2.5.x to 3.3.2 on the above platforms... (It might work on earlier versions of Python but untested.)</p> <p>Enjoy finding simple solutions to often very difficult problems...</p> <p>Bazza...</p> pack multiple images of different sizes into one image (Python) 2013-06-27T14:50:37-07:00Hugohttp://code.activestate.com/recipes/users/4183663/http://code.activestate.com/recipes/578585-pack-multiple-images-of-different-sizes-into-one-i/ <p style="color: grey"> Python recipe 578585 by <a href="/recipes/users/4183663/">Hugo</a> (<a href="/recipes/tags/graphics/">graphics</a>). </p> <p>Packing images of different sizes into one image is often required in order to efficiently use hardware accelerated texture mapping functions of 3D video cards.</p> Random Maze Generator (Python) 2012-12-14T09:09:22-08:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/578356-random-maze-generator/ <p style="color: grey"> Python recipe 578356 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/ai/">ai</a>, <a href="/recipes/tags/game/">game</a>, <a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/pil/">pil</a>). Revision 2. </p> <p>Random maze generator using depth-first search.</p> <p>It starts the maze path from a random cell and there is no exit defined but actually any 2 cells on the path (white cells) can be assigned to be entry and exit locations. (I could just add code to randomly select 2 white cells and change their colors to something else but I thought it looks better this way.)</p> Random Multi-Maze Generator (Python) 2012-12-14T11:23:29-08:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/578378-random-multi-maze-generator/ <p style="color: grey"> Python recipe 578378 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/ai/">ai</a>, <a href="/recipes/tags/game/">game</a>, <a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/pil/">pil</a>). </p> <p>Randomly creates mazes which have multiple paths to solve. Entry and exit points for each path can be assigned arbitrarily. (I never seen this kind of maze anywhere before but I think calling them multi-maze should be okay.)</p> Use PIL to make a "contact sheet" montage of images (Python) 2012-09-21T11:06:58-07:00Hugohttp://code.activestate.com/recipes/users/4183663/http://code.activestate.com/recipes/578267-use-pil-to-make-a-contact-sheet-montage-of-images/ <p style="color: grey"> Python recipe 578267 by <a href="/recipes/users/4183663/">Hugo</a> (<a href="/recipes/tags/graphics/">graphics</a>). Revision 2. </p> <p>The Python Imaging Library (PIL) makes many tasks easy in digital photography. This recipe shows how to make a "contact sheet" of images, a single image with thumbnails of many different pictures. It's limited in that it will only work with pictures of the same shape, but you can make some really fun images.</p> Draw SVG Images In Python (Python recipe) - enhanced Version (Python) 2012-05-10T16:27:18-07:00Isendrak Skatasmidhttp://code.activestate.com/recipes/users/4182031/http://code.activestate.com/recipes/578123-draw-svg-images-in-python-python-recipe-enhanced-v/ <p style="color: grey"> Python recipe 578123 by <a href="/recipes/users/4182031/">Isendrak Skatasmid</a> (<a href="/recipes/tags/graphics/">graphics</a>). </p> <p>This script draws simple SVG images composed of circles, squares, lines, text, etc.</p> C# Surface Normal (Java) 2010-08-06T21:00:07-07:00John Hurlimanhttp://code.activestate.com/recipes/users/4174599/http://code.activestate.com/recipes/577348-c-surface-normal/ <p style="color: grey"> Java recipe 577348 by <a href="/recipes/users/4174599/">John Hurliman</a> (<a href="/recipes/tags/csharp/">csharp</a>, <a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/normal/">normal</a>). </p> <p>Calculates a surface normal given three position vectors in clockwise order. Written in C#</p> CPU Usage Graph Applet (Java) 2010-03-26T01:12:44-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577145-cpu-usage-graph-applet/ <p style="color: grey"> Java recipe 577145 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/applet/">applet</a>, <a href="/recipes/tags/cpu_usage/">cpu_usage</a>, <a href="/recipes/tags/graphics/">graphics</a>). </p> <p>It calculates CPU speed w/o using any system calls etc. Instead it simply uses a timed counter.</p> Pad images to power-of-two dimensions. (Python) 2008-08-12T18:46:40-07:00Martin Wilsonhttp://code.activestate.com/recipes/users/4166376/http://code.activestate.com/recipes/576416-pad-images-to-power-of-two-dimensions/ <p style="color: grey"> Python recipe 576416 by <a href="/recipes/users/4166376/">Martin Wilson</a> (<a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/imaging/">imaging</a>, <a href="/recipes/tags/library/">library</a>, <a href="/recipes/tags/of/">of</a>, <a href="/recipes/tags/opengl/">opengl</a>, <a href="/recipes/tags/pil/">pil</a>, <a href="/recipes/tags/power/">power</a>, <a href="/recipes/tags/power_of_two/">power_of_two</a>, <a href="/recipes/tags/python_imaging_library/">python_imaging_library</a>, <a href="/recipes/tags/two/">two</a>). Revision 4. </p> <p>Pads any amount of images each to power-of-two dimensions, useful for OpenGL programming.</p> ffmpeg ppm.so vhook plugin (Python) 2008-05-26T09:41:05-07:00Konrads Smelkovshttp://code.activestate.com/recipes/users/2852558/http://code.activestate.com/recipes/572220-ffmpeg-ppmso-vhook-plugin/ <p style="color: grey"> Python recipe 572220 by <a href="/recipes/users/2852558/">Konrads Smelkovs</a> (<a href="/recipes/tags/graphics/">graphics</a>). </p> <p>This recipe shows how to read a continuous stream of PPM frames as output by ffmpeg ppm.so vhook. In this example, the image is flipped and output back.</p> Drop shadows with PIL (Python) 2006-03-06T03:26:54-08:00Kevin Schluffhttp://code.activestate.com/recipes/users/1496147/http://code.activestate.com/recipes/474116-drop-shadows-with-pil/ <p style="color: grey"> Python recipe 474116 by <a href="/recipes/users/1496147/">Kevin Schluff</a> (<a href="/recipes/tags/graphics/">graphics</a>). Revision 2. </p> <p>This recipe demonstrates the use of the Python Imaging Library to apply a gaussian blur drop shadow to an image.</p> PIL and Tkinter to display images. (Python) 2007-06-20T19:25:41-07:00Noah Spurrierhttp://code.activestate.com/recipes/users/103276/http://code.activestate.com/recipes/521918-pil-and-tkinter-to-display-images/ <p style="color: grey"> Python recipe 521918 by <a href="/recipes/users/103276/">Noah Spurrier</a> (<a href="/recipes/tags/graphics/">graphics</a>). Revision 3. </p> <p>Using PIL and Tkinter you can easily display images in a window.</p> aebovl - Automatic Exposure Bracket Image Overlay (Python) 2007-05-12T19:19:44-07:00Jim Egglestonhttp://code.activestate.com/recipes/users/2894856/http://code.activestate.com/recipes/519636-aebovl-automatic-exposure-bracket-image-overlay/ <p style="color: grey"> Python recipe 519636 by <a href="/recipes/users/2894856/">Jim Eggleston</a> (<a href="/recipes/tags/graphics/">graphics</a>). </p> <p>aebovl is a script that overlays images of the same scene taken at different exposures. This brightens under-exposed areas and darkens over-exposed areas of the image. This generates a kind of poor man's HDR image.</p> Cataloging and adding IPTC keywords to digital photos (Python) 2007-01-19T13:38:49-08:00Chad Cooperhttp://code.activestate.com/recipes/users/4023200/http://code.activestate.com/recipes/500266-cataloging-and-adding-iptc-keywords-to-digital-pho/ <p style="color: grey"> Python recipe 500266 by <a href="/recipes/users/4023200/">Chad Cooper</a> (<a href="/recipes/tags/exif/">exif</a>, <a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/iptc/">iptc</a>, <a href="/recipes/tags/photography/">photography</a>). </p> <p>This script helps me manage my digital photos by filing them in a directory based on the EXIF date and applying keywords and by-line information to the IPTC metadata.</p>