Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > [wx] Simple image editor

Reply
Thread Tools

[wx] Simple image editor

 
 
Michele Petrazzo
Guest
Posts: n/a
 
      10-30-2004
I want to create a simple image editor (with wxPython) for my application.
Now I'm able to zoom, draw with a pen, insert a text into the loaded
image, and undo changes (for this I reload the image and redraw all the
lines/text, but not the last.)

My problem is how can I move the texts/lines that are insert into Image,
after placed? How the image editors (like GIMP) are able to move the
objects? Please don't tell me to read the GIMP's source .

Thanks,
Michele

P.s. I hope you understand me, my English is horrible.
 
Reply With Quote
 
 
 
 
Cliff Wells
Guest
Posts: n/a
 
      10-30-2004
On Sat, 2004-10-30 at 11:28 +0200, Michele Petrazzo wrote:
> I want to create a simple image editor (with wxPython) for my application.
> Now I'm able to zoom, draw with a pen, insert a text into the loaded
> image, and undo changes (for this I reload the image and redraw all the
> lines/text, but not the last.)
>
> My problem is how can I move the texts/lines that are insert into Image,
> after placed? How the image editors (like GIMP) are able to move the
> objects? Please don't tell me to read the GIMP's source .


First of all, if you are talking about bitmaps, then there are no such
things as "objects" in that sense, there is only a big bunch of bits.
What programs like the Gimp do is keep several (possibly hundreds) of
separate bitmaps for each of the objects and then composite them
together to give you a unified view of your "bitmap". So the first
thing you'll need is a framework for managing all those objects. This
should be fairly straightforward in Python. Second, you can use the
built-in wxPython image handling tools or take a look at something like
PIL for doing the compositing.



Regards,
Cliff

--
Cliff Wells <(E-Mail Removed)>

 
Reply With Quote
 
 
 
 
Jeremy Bowers
Guest
Posts: n/a
 
      10-30-2004
On Sat, 30 Oct 2004 11:28:35 +0200, Michele Petrazzo wrote:

> Please don't tell me to read the GIMP's source .


Why read GIMP's source when you can use it?

Can you shell out your manipulations, and then just take a changed version
of the image back in?

Of course, any image editor will work then, too.

Maybe not, I don't know your needs. But it is worth thinking about. Image
editors are in the class of applications that you should go to great
lengths to avoid rewriting. To get anything beyond the Paint that shipped
with Windows 3.1 is a major effort, plus unless you really, really know
your users don't want anything but primitive text overlays, you're asking
for an infinite amount of feature requests to add things that other image
editors already have. Plus, the naive implementations of things like
"undo" eat memory for lunch.

Take a look at the *size* of the GIMP, even without the filter plugins.
Are you sure you want to take that job on? Even a subset can get massive,
fast.

 
Reply With Quote
 
Michele Petrazzo
Guest
Posts: n/a
 
      11-02-2004
Cliff Wells wrote:
> On Sat, 2004-10-30 at 11:28 +0200, Michele Petrazzo wrote:
>
>>I want to create a simple image editor (with wxPython) for my application.
>>Now I'm able to zoom, draw with a pen, insert a text into the loaded
>>image, and undo changes (for this I reload the image and redraw all the
>>lines/text, but not the last.)
>>
>>My problem is how can I move the texts/lines that are insert into Image,
>>after placed? How the image editors (like GIMP) are able to move the
>>objects? Please don't tell me to read the GIMP's source .

>
>
> First of all, if you are talking about bitmaps, then there are no such
> things as "objects" in that sense, there is only a big bunch of bits.
> What programs like the Gimp do is keep several (possibly hundreds) of
> separate bitmaps for each of the objects and then composite them
> together to give you a unified view of your "bitmap". So the first
> thing you'll need is a framework for managing all those objects.


Ok. I'll divide all my "objects" into a lot of bitmaps.

> This
> should be fairly straightforward in Python. Second, you can use the
> built-in wxPython image handling tools or take a look at something like
> PIL for doing the compositing.

I'm using yet both wxPython and PIL. So the work will not be very hard.

>
> Regards,
> Cliff
>


Thanks.
Michele Petrazzo
 
Reply With Quote
 
Michele Petrazzo
Guest
Posts: n/a
 
      11-02-2004
Jeremy Bowers wrote:
> On Sat, 30 Oct 2004 11:28:35 +0200, Michele Petrazzo wrote:
>
>
>>Please don't tell me to read the GIMP's source .

>
>
> Why read GIMP's source when you can use it?

Because I want to understand how it work, not how the user use the tools.

> Can you shell out your manipulations, and then just take a changed version
> of the image back in?
>
> Of course, any image editor will work then, too.
>
> Maybe not, I don't know your needs. But it is worth thinking about. Image
> editors are in the class of applications that you should go to great
> lengths to avoid rewriting. To get anything beyond the Paint that shipped
> with Windows 3.1 is a major effort, plus unless you really, really know
> your users don't want anything but primitive text overlays, you're asking
> for an infinite amount of feature requests to add things that other image
> editors already have.


I want to add a simple image editor into my application, that not is an
image editor,but a fax client, so the features of place text/lines are
the only that I need.

> Plus, the naive implementations of things like
> "undo" eat memory for lunch.

The "undo" work yet correctly.I have three list with:
1) all the points of the lines, ...
2) text, font, color, position, dimensions, ...
3) "l" or "t", that mean line or text.
Every time that I place a line, I append into list 1 all the values and
into list 3 a "l". for the text is the same.
When I press undo button, I pop a value from list 3, and pop a value
from correspondent list. After this I rewrite all the bitmaps.

It work, but if I have a lot of "objects", I must attempt that it redraw
all.

Thanks,
Michele Petrazzo
 
Reply With Quote
 
Scott David Daniels
Guest
Posts: n/a
 
      11-02-2004
Michele Petrazzo wrote:
> ... if I have a lot of "objects", I must attempt [to] redraw all.

One simplification that can speed things up tremendously (in the case
that you can ignore write order), is to have a "selected" object, and
an image of "everything else" on which you draw the "selected" object
as you move it around.

-Scott David Daniels
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need low resource, simple image editor that handles CMYK, Tif, andpostscript. mechphisto@gmail.com Digital Photography 5 01-12-2008 08:15 PM
Anybody using colour-science.com's Image Editor or Image Factoryapplciations? David Dyer-Bennet Digital Photography 0 03-17-2007 03:09 AM
simple image editor Jim Digital Photography 22 12-15-2005 03:51 AM
ANN: New low-cost XML Editor, XSLT Editor, XSLT Debugger, DTD/Schema Editor Stylus Studio Java 0 08-03-2004 03:53 PM



Advertisments