processing images to look like halftone print
I have always liked old prints that look like they are made up of many small dots. This process / look is called halftone.
Here is an example of a black and white halftone print of an old Barbarella poster. (click on the right black and white images below to see what i’m talking about)



I made a python script that sort of replicates this look, using PIL. You can grab my halftone script here.
You can create dotted images in black and white or colour. You can have white dots on a black background, or black dots on a white background. So essentially a positive or negative method of dotting. The script gets some cool results, but it is quite slow, especially when you have a smaller dot size or larger resolution source files. As it builds a new image dot by dot, the more dots the more time it takes.
Here are some of my tests. Click on the images for full effect: please note they are obviously not from photos i have taken myself, and the sources and credits are unknown.

Usage
From commandline:
python pathToLB_halftone_v1.0.py fileOrFolderToSourceFrom args
or of course, you can alias it to ‘dot’ or whatever you like.
FLAGS:
-s –squareSize Sets the number of pixels allocated for each dot shape. Eg: 6 = more small dots 16 = fewer larger dots
-c –colours Sets the script to colour mode.
-f –fileType Sets the filetype for new files created. Supported types are: [ "jpeg", "tiff", "gif", "png" ]
-n –negative Sets the script to negative mode (being black dots on a white background) rather than the default, (white dots on a black background).
The python script i have made produces image results very similar to half tone -I guess the only difference is the dots are displayed in line with each other rather than in a zigzag pattern.
I would love to use either this script or my pixelize script to process some of my animation, for a stylized effect. Even animate the dot size over time perhaps? I guess that could be another idea…
Further info on halftone.
backup your stuff! ….for 39kb on mac or 176kb on windows.
Computers suck. They can die on you at the worst time and you don’t want to lose your important stuff, like your mp3 collection…
I’m not really interested in backup systems that restore my computer to certain points in time, like time-machine. Although these are well designed and useful systems, they can be confusing and you can lose track of your files, as such systems are time based. All I want is a simple, reliable tool that archives important stuff, so I have peace of mind that my precious files are BACKED UP! So I wrote my own little backup utility in Python.
I originally wrote this for my personal Mac, and later adapted the script to work on Windows. I use windows for work, and there is a lot of data created daily that needs to be kept safe. The script backs up to external hard drives. I have multiple drives enabled on the Windows version that I use at work so I can rotate the drives daily -keeping one drive offsite (in case or fire, burglary, rodents etc). The other handy thing about the Windows one is that you can log out and it will run and then it can shut your machine down when finished (if you wish to shutdown). So once set up -all you need to do is log out of your machine and it takes care of everything.
The scripts are basically an organiser around the unix ‘rsync’ utility. Rsync doesn’t exist on Windows systems, so I have included an rsync.exe in the Windows version.
Both of the bundles have a folder of little bits and pieces. In the folder is the main Python script, you will need to open this in a decent text editor and edit some of the details to make it customized for your system. Note it is best to run the script via an automation system. The Windows version has an ‘instructions’ file for how to do this and setup Windows Scheduler. The Mac version has a cron file for automating via commandline with crontab. If you set this automation you can literally ’set and forget’. The script has inbuilt mail notification, which provides all information about the script output, so you can monitor the process.
Ahhh, peace of mind.
create lower resolution image proxies with python
For those who are friends of the command line, here is a simple python script that utilises PIL to generate lower resolution proxy images of your larger files.
This is often handy when doing any kind of vfx work where smaller files allow for faster interaction. The script is setup to process individual files or entire folders of images. I also use it a lot for quickly creating emailable size images from the larger res downloads off my digital camera. At the moment the script is setup merely to create jpeg type files, but I wanted to later implement the option of maintaining the original file format, or just specifying an output filetype.
Usage
From commandline:
python pathToLB_proxyMaker.py fileOrFolderToSourceFrom args
or of course, you can alias it to ‘proxy’ or whatever you like.
FLAGS:
-d –division Sets the divisional amount to create the new smaller res files. The images will be divided by this number.
-w –web Sets the target proxy Res so that the larger dimension is 640 – which is an ideal size for email and web work. If images are smaller than this res they will not be altered.
-1 –1k Sets the target proxy Res so that the larger dimension is 1024 – for a 1k approximation. If images are smaller than this res they will not be altered.
-t --type CURRENTLY NOT IMPLEMENTED: is intended to maintain the file format of the original files -otherwise will default to jpeg.
You can get it to make proxies based on a division amount of the original res -half res, quarter res etc. This is by using the “-d” flag followed by a dividing number. Eg. “-d 2″ will make half res files or “-d 4″ will make quarter res files. I have also included a couple of handy modes for making web or email size files.The flag “-1″ will make 1k files (where the larger of the 2 dimensions is set to 1024 pixels), or the flag “-w” makes a slightly smaller equivalent, where the larger of the 2 dimension is set to 640 pixels.
Known drawbacks
Unfortunately the version of PIL available at the time I wrote this post has a few annoying limitations. The main problem is that it will not maintain the image’s colour profile, or any other associated meta data. So if you have a particular colour profile assigned to your images, say ’sRGB’, it will not exist on the newly output proxy files. On my computer (Mac) I think it just assigns a ‘colour LCD’ profile upon opening the images -which can often look rather ordinary. Although you can manually reassign a colour profile to your images at a later date. I think there are various scripts out there that can do this, but that again is irritating as it means it becomes a 2 part process. I believe the next version of PIL (1.1.7) should address maintaining the colour profile across image manipulation.
pixelizing images with python
I’ve been playing around with PIL (python image library) learning how to mash images in various ways. This was my second script after the proxy making script. It converts an image into a pixelized version. You can choose how many pixels across (along the smaller resolution) and how many colours you wish to convert to. So some of the images end up looking like old 8 bit video game stills. Kinda cool. Obviously you get better results form using bold, contrasty pictures.
Here’s a couple of tests. Please note these are not my images, and cannot credit the photographers as I don’t know who they are.
Most graphical programs have ways of doing this as an effect or filter. I know there is a shake node for it. Though I like it how this one you can adjust the number of colours at the same time, and it’s pretty fast. It is also setup to batch process directories of images via command line. click here to download the pixelize python script.














