GUI to browse and select images

K

ktenney

Howdy,

I've written some code which manipulates images,
now I want an interface for choosing images.

I'm curious what people might recommend as the
easiest way framework to do the following:

- present a (directory) view, with images represented
by thumbnails

- provide structure for selecting images

- provide structure for choosing manipulations
to send the selected images to. (the selected
image file name(s) become paramaters to functions)

Thanks,
Kent
 
K

ktenney

D,

I am interested in a very simple interface.
A frame filled with thumbnails
of images, allowing selecting multiple items.

I want to implement these thumbnail standards;
http://triq.net/~jens/thumbnail-spec/index.html
The set of thumbs in a frame would come from a list of
thumb image file names. The list might be generated
according to the contents of a directory, might be
from a database query.

The spiffy management and manipulation functionality
would be handled by right-click menus.

It seems the fashionable way to do such
things (Zope3, Chandler, PEAK ...) is
XML style configuration files.

<RightClickChoices>
<menuitem label="Make Master',
description = 'Convert image to tif, load in The Gimp',
implements = ImageTools.MakeMaster />

<menuitem label = 'email image(s)',
description = 'Resize, compress, prompt for address, send',
implements = ImageTools.Relocate.EmailImage />

<menuitem label = 'Manipulate image',
description = 'modify the image(s) in some cool way',
implements = ImageTools.Manipulations />

<submenu>
<menuitem label = 'swap palettes',
description = 'exchange the colors used in 2 images',
implements = ImageTools.Manipulations.SwapPalettes
/>

<menuitem label = 'embed images',
description = 'place the image chosen first
inside the second',
implements = ImageTools.Manipulations.Embed />
</submenu
....
</RightClickChoices>

When a new routine is developed, it is entered into the menu
configuration and becomes available to the app.

The code might look like;

import Chooser, ImageTools
GUI = Chooser.Chooser()

images = getthumbchoices(path.imagefiles)
-or-
images = query('select thumb where mydb.client = webclient')

selectedimages, selectedmenuitem = GUI(images)
ImageTools.implement(selectedimages, selectedmenuitem)

I expect filesystem navigation would be handy,
that could be handled by a tree widget which
would send lists to the GUI.

I like the idea of the GUI remaining very simple, clean and fast,
with very flexible functionality behind it.

I don't have the time or coding skills to implement it in
anything but high level components..

Thanks,
Kent
 
M

M.E.Farmer

Hello,
Have you looked into wxPython? PIL?
1)use your code or PIL to do your manipulations
2)create thumbnails ( PIL )
3)generate an HTML page ( custom look , easy layout )
4)overide OnLinkClicked() to capture user selections (wxHTMLWindow.OnLinkClicked())
5)use wxHTMLWindow to display the page. ( wxHTMLWindow.SetPage(yourHTML) )
6)...
It should be fairly easy to get this running.
300 to 1000 lines depending on details...just a guess ;)
wxHtmlWindow is a not even fully compliant with html 2,
but 'old-skool' table layout works.
Maybe someone will post with something better ;)
HTH,
M.E.Farmer
 
K

ktenney

M.E.,

Good ideas.

I'm using PIL, it's great, and getting better.
I don't know anything about wxPython other than it comes
highly recommended.

I really like the html based approach.

Could you give me (or point me to) a brief description of how
wxHTMLWindow works?

Does it provide for selecting multiple items? (required for this app)
Thanks,
Kent
 
M

M.E.Farmer

Kent,
Sorry for the delay. I wrote you a nice reply and then killed it
with an accidental click . Oh well.....
wxPython is a c++ based framework (wxWidgets) with many backends.
The best way to learn it is to run the demo and play with the code.
Got to 'http://www.wxPython.org' and download the latest build and be
sure to grab the demo (if you are on windows it is built into the
distro).
Install it and run the demo. It is an easy install.
The docs are based on c++ but they are easy to use and are on the net
also.
wxHtmlWindow supports a few protocols and can load in memory files.
There are many events exposed by wxWidgets and wxHtmlWindow has many
available.
Decide on functionality and set handlers for those events
(LeftClickUp,RightClickDown, etc..)You should be able to do anything
want with it.
But, I have been wrong before :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,689
Members
48,796
Latest member
Greg L.

Latest Threads

Top