CAD CAM EDM DRO - Yahoo Group Archive

Re: Images into toolpath (was Software question)

on 2005-11-19 06:19:44 UTC
With the code snippet I posted I only wanted to illustrate how little
programming is necessary to load any of the common image file formats,
and then manipulate it, or reading the pixel information and convert
it into something else, a z height for a toolpath for example.

Python is a programming language, and there are lots of libraries
available for it to write computer programs for a wide range of
applications. And, it is absolutely free.

The Enthought Edition is a convenient bundle of python together with
all these libraries. It can be downloaded for free from the site I
gave before.

Have a look there, or start with the beginner's guide on www.python.org

Hope this is not too off the topic, but I believe that most of you
know a great deal about programming already. To write a little program
that reads a jpeg and generates a toolpath that changes the z
depending on the color value, or a greyscale value, is not really that
difficult, not with python.

Martin







--- In CAD_CAM_EDM_DRO@yahoogroups.com, "Victor A. Estes"
<emc3zach@h...> wrote:
>
> Martin,
>
> What does this program do?
>
> Victor A.
> ----- Original Message -----
> From: "Martin Dunschen" <zabaione@u...>
> To: <CAD_CAM_EDM_DRO@yahoogroups.com>
> Sent: Thursday, November 17, 2005 7:18 AM
> Subject: [CAD_CAM_EDM_DRO] Images into toolpath (was Software question)
>
>
> > 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
> >
> >
> >
> >
> >
> > Addresses:
> > FAQ: http://www.ktmarketing.com/faq.html
> > FILES: http://groups.yahoo.com/group/CAD_CAM_EDM_DRO/files/
> > Post Messages: CAD_CAM_EDM_DRO@yahoogroups.com
> >
> > Subscribe: CAD_CAM_EDM_DRO-subscribe@yahoogroups.com
> > Unsubscribe: CAD_CAM_EDM_DRO-unsubscribe@yahoogroups.com
> > List owner: CAD_CAM_EDM_DRO-owner@yahoogroups.com, wanliker@a...,
> > timg@k...
> > Moderator: pentam@c... indigo_red@q... davemucha@j...
> > [Moderators]
> > URL to this group: http://groups.yahoo.com/group/CAD_CAM_EDM_DRO
> >
> > OFF Topic POSTS: General Machining
> > If you wish to post on unlimited OT subjects goto:
> > aol://5863:126/rec.crafts.metalworking or go thru Google.com to
reach it
> > if you have trouble.
> > http://www.metalworking.com/news_servers.html
> >
> > http://groups.yahoo.com/group/jobshophomeshop I consider this to
be a
> > sister site to the CCED group, as many of the same members are
there, for
> > OT subjects, that are not allowed on the CCED list.
> >
> > NOTICE: ALL POSTINGS TO THIS GROUP BECOME PUBLIC DOMAIN BY POSTING
THEM.
> > DON'T POST IF YOU CAN NOT ACCEPT THIS.....NO EXCEPTIONS........
> > bill
> > List Mom
> > List Owner
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
>

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)