CAD CAM EDM DRO - Yahoo Group Archive

Images into toolpath (was Software question)

on 2005-11-17 05:18:47 UTC
For those who know a little how to programme I suggest to have
a look at the python imaging library.

It is free and can be downloaded at various places, for example here
http://www.pythonware.com/products/pil/

To read an image file and scan through the data is done very easily
with a few lines of code,
for example:

....
import Image
f = Image.open("myimg.jpg") # this can be any image file, jpeg, png,
bmp, tiff...
print f.size # the dimensions of your image in pixels

for i in range(f.size[0]):
for j in range(f.size[1]):
c = f.getpixel((i, j)) # the color at pixel i, j
...

(this is just a code snippet! No guarantee that there are no syntax
errors.)
Read it up in the PIL documentation how to use it.

For windows users, I think Python Enthought Edition includes this
library.
Download here. http://www.enthought.com/python/

Linux users should have python on their computers already, or use your
package installer to get it.

Martin

Discussion Thread

Martin Dunschen 2005-11-17 05:18:47 UTC Images into toolpath (was Software question) Victor A. Estes 2005-11-18 12:59:50 UTC Re: [CAD_CAM_EDM_DRO] Images into toolpath (was Software question) martindunschen 2005-11-19 06:19:44 UTC Re: Images into toolpath (was Software question)