New Image Menu Functionality

Discussion related to the implementation of new features & algorithms to the Core Engine.

Moderators: jromang, tomb, zcott, coordinators

New Image Menu Functionality

Postby Olliebrown » Fri Nov 05, 2010 9:09 pm

Greetings!

I recently had a need to output images (both tonemapped and, if possible, HDR OpenEXR) from a bunch of FLMs (more here: http://www.luxrender.net/forum/viewtopic.php?f=16&t=4542).

And so I decided to slap together the 'Image' menu that I found mentioned by LordCRC in a features request thread somewhere. I posted some patches at the thread link above and LordCRC himself grabbed the most basic one and committed it into the code base *tnx for that by the way :D *

I've taken this little 'Image' menu in the GUI and expanded it quite a bit for myself and thought I'd offer up those changes as well (if interested). Of course, I found out that LordCRC is working on a whole new imaging pipeline so I imagine a lot of this would change down the road but having the GUI figured out and getting some basic functionality in there now for those that want it couldn't hurt. Anyways, here's some of the changes I've made since then:

- First and foremost, I found what I think is a bug in the RenderView::copyToClipboard() function. It passes the raw framebuffer to a QImage without specifying the bytes per row and QImage wants row bytes to be 32bit alligned by default. So I fixed that to look like the call to QImage() a few functions below it (also, in my own RenderView::outputTonemapped() function which had duplicated this mistake). It's a real simple patch, only changes 2 lines of code. I've included it below.

- I had also added a menu option to output OpenEXR files but had cautioned that it was a much bigger change than the one LordCRC had grabbed. I've used it quite a bit since then and feel pretty confident that it should work okay.

- I went on to add two more options: outputting of each individual light group to images (LDR or HDR) and a batch processing dialog that would read all FLMs in a directory and output them as images in any of the above flavors (LDR, HDR, individual light groups, etc).

I'll post a few screenshots of what it looks like. I've used it a fair deal already and it seems pretty stable (on my one system of course, not much of an exhaustive test). I don't have the code for the rest of these changes handy at the moment but if y'all are interested though, I'd be happy to clean it up and post it here. Just let me know!

Cheers!
Seth

P.S. I'd caution against the other patches I've posted in the above thread as I've changed things here and there since then. Might be cleaner if I just post a new patch (not to mention, they're a ways behind the tip of the source tree now).

ImageMenu.png
Full Image menu with additional output options.

BatchProcessOpts-Filled.png
Dialog for processing a batch of FLMs in a single directory.

BatchProgress.png
Simple progress dialog for the batch processing.
Attachments
TonemappedExportFix.tgz
Patch to fix bug in clipboard export and tonmapped output.
(892 Bytes) Downloaded 23 times
Olliebrown
 
Posts: 53
Joined: Wed Nov 04, 2009 9:15 pm

Re: New Image Menu Functionality

Postby Carbonflux » Sat Nov 06, 2010 5:18 am

Thank you for implementing this, this functionality was long overdue, thanks also for looking into the clip-board bug :)

One very slight issue, traditionally functions like this tend to belong in the file menu, but I don't really think thats too important.

Nice work :)
www.carbonflux.org - photographing the imagination.
User avatar
Carbonflux
Developer
 
Posts: 1488
Joined: Thu Aug 07, 2008 7:22 pm
Location: Seattle, WA, USA.

Re: New Image Menu Functionality

Postby Abel » Sat Nov 06, 2010 6:03 am

Excellent! This will help avoid at least one minor annoyance that I suspect many users have or have had. I'm sure the option to save all light groups as separate images is going to save me some work in the future. Now if only they would be saved in separate layers in a .xcf (and/or .psd) file, that would be really convenient. :)

Also fixing the clipboard option is much appreciated.

Carbonflux wrote:traditionally functions like this tend to belong in the file menu, but I don't really think thats too important.

My thoughts exactly except that I do think it is somewhat important.
User avatar
Abel
Developer
 
Posts: 1583
Joined: Sat Oct 20, 2007 8:13 am
Location: Zürich, Switzerland

Re: New Image Menu Functionality

Postby Olliebrown » Sat Nov 06, 2010 7:12 am

Great!

Concerning the File menu vs image menu, It's pretty easy to switch it around. Maybe I can mock it up in the File menu too and post an image of that, have people vote. * Go Democracy :D *

I think the reasoning for having it in the 'image' menu instead of the 'file' menu was just a desire to keep the file menu from getting cluttered. I don't feel strongly one way or the other myself. I would defer to precendent and in that case, you are absolutely right, it belongs in the file menu.

I'll be out of town this weekend (going to Green Bay to see the Packers) but once I get back I'll work on this and post the full patch.
Olliebrown
 
Posts: 53
Joined: Wed Nov 04, 2009 9:15 pm

Re: New Image Menu Functionality

Postby Carbonflux » Sat Nov 06, 2010 7:47 am

Again thanks for implementing this.

The menu placement is not really a subjective issue, there are various style guides etc, mostly related to commercial software, UI is not "black magic." In fact in many ways it might be the single hardest and yet most tedious aspect of programming, with math its a lot easier to predict the control flow but when a user is involved it gets a lot more complex, people will always do things you will never have predicted, in fact its the bane of "smart people." I have again and again heard "smart people" think they can predict what a user will do and be totally surprised when they release software and find the user breaks it within hours of the release.

I prefer "cynical people" over "smart people" 9 times out of 10 ;)

With FOSS the issue is more complex, which is why I submitted it is a minor issue and was properly corrected by Abel.

Menus will always get "cluttered" in a mature app, from years of experience style guides emerged as a way of dealing with lessons learned, the best way to deal with the clutter is to place things in correct categories.

My point being, don't underestimate the importance of UI design. :)
www.carbonflux.org - photographing the imagination.
User avatar
Carbonflux
Developer
 
Posts: 1488
Joined: Thu Aug 07, 2008 7:22 pm
Location: Seattle, WA, USA.

Re: New Image Menu Functionality

Postby Olliebrown » Tue Nov 09, 2010 4:10 pm

Point well made. Conceptually, I think this functionality falls under the 'export' category (we're exporting the internal film data to a universal image format of one sort or another). Given that (and my own experiences with programs that provide export functions ... thinking Blender, photoshop, etc) this does belong under the File menu. I will spend a moment or two examining exactly how some of these other programs do this and ultimately try to emulate them.

I'm pulling the changes together right now and will upload a patch later today ... if my son keeps napping!

Seth
Olliebrown
 
Posts: 53
Joined: Wed Nov 04, 2009 9:15 pm

Re: New Image Menu Functionality

Postby Olliebrown » Tue Nov 09, 2010 5:41 pm

Here we go! Hopefully this is easy to import. I pulled the latest changes to my local repository and merged to a single head before adding things. Looks like there's been some editing of the FlexImageFilm class recently and as such, it would not compile on my computer. I made an edit to get past the error for now and that one change will likely conflict with the current head version. Otherwise, my changes should all be easy to merge in (either entirely separate functions or obvious chunks that can slide right between existing code).

Here's a screenshot of how I did the menus in this patch:
FileMenuExport.png
Image export options under File menu.

There's a sub-menu called 'export to image' that contains what I had put in the 'Image' menu before. All other apps like to group 'export' operations in sub-menus like this so as long as everyone is on board with this being an 'export' operation I think this makes the most sense but of course, I'm happy to defer to the wishes of the more senior maintainers here.

Enjoy! :D (and let me know if there's any problems of course)
Seth
Attachments
ExportToImage.tgz
Patch to update/improve exporting flms to standard image files.
(8.97 KiB) Downloaded 25 times
Olliebrown
 
Posts: 53
Joined: Wed Nov 04, 2009 9:15 pm

Re: New Image Menu Functionality

Postby Carbonflux » Tue Nov 09, 2010 6:32 pm

That looks good to me :)

Gratz on the Greenbay win also :D
www.carbonflux.org - photographing the imagination.
User avatar
Carbonflux
Developer
 
Posts: 1488
Joined: Thu Aug 07, 2008 7:22 pm
Location: Seattle, WA, USA.

Re: New Image Menu Functionality

Postby jensverwiebe » Tue Nov 09, 2010 8:09 pm

Mucho gratias Seth :)

I commited your great stuff to repo tonight.

Lord will add overlay statistics printable to imagebottom, there we go :)

renderstats2.png
overlay statistics

export_seperate-LG-test.jpg
sun/sky/area seperate export_test


Jens
User avatar
jensverwiebe
Developer
 
Posts: 2328
Joined: Wed Apr 02, 2008 4:34 pm

Re: New Image Menu Functionality

Postby Lord Crc » Tue Nov 09, 2010 9:52 pm

Glad it's not just me ;)

jens, you forgot to "hg add" the batchprocessdialog.* files :)
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4932
Joined: Sat Nov 17, 2007 2:10 pm

Next

Return to Architecture & Design

Who is online

Users browsing this forum: No registered users and 2 guests