Permlink Replies: 11 - Pages: 1 - Last Post: 29 Apr 13, 14:08 Last Post By: davidekholm
davidekholm

Posts: 3,442
Registered: 18-Oct-2002
LimitAreaFilter
Posted: 11 Apr 13, 14:03
  Click to reply to this thread Reply
A user wished all images generated from jAlbum to stay at the same number of megapixels, i.e all to have the same area (width * height), no matter if the images fed are portrait, landscape or squary.

To support this request I've written the "LimitAreaFilter" which will be embedded in future jAlbum releases, but you can play with it right away (and embed in your skins if you wish).

Here's how to use it:
  • First set the image bounds and thumbnail bounds to squary values indicating dimensions the generated images should never exceed.
  • Then, add user variables under advanced album settings limiting the number of megapixels for the generated images. Here's a sample that limits the area of both closeup images and thumbnail images:
    filter1	class=LimitAreaFilter area=0.2 closeups
    filter2	class=LimitAreaFilter area=0.003 thumbnails
    
    To get started, put the attached LimitAreaFilter.java and LimitAreaFilter.class files inside jAlbum's "plugins" folder, then unzip and open the attached sample project.
JeffTucker

Posts: 8,039
Registered: 31-Jan-2006
Re: LimitAreaFilter
Posted: 11 Apr 13, 14:19   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
Interesting, though I'm not sure I grasp the utility of it. I'll have to mull over that one.

I've got a user who would like something similar, but in his case what he wants is a fixed shape filter that doesn't crop, but pads out the images. In movie terms, letterboxing instead of pan and scan. I suppose the filter would have to let you specify what the padding should consist of - colored side or top/bottom bars, for example. The actual image should be centered, of course. Too bad JPG doesn't support transparency - the side bars could be transparent!

You might think, "what good would that be?" But then think about Matrix, in which the size of the expander is dependent upon the size of the image. With images that have been padded out to a consistent size, moving from image to image would not involve any change in the size or position of the expander, and yet that expander would still adapt itself to the size of the viewport.
JeffTucker

Posts: 8,039
Registered: 31-Jan-2006
Re: LimitAreaFilter
Posted: 11 Apr 13, 14:39   in response to: JeffTucker in response to: JeffTucker
  Click to reply to this thread Reply
EarlyOut wrote:
Interesting, though I'm not sure I grasp the utility of it. I'll have to mull over that one.

Now I see how that would be advantageous. I'm not sure I could explain it to a user, however, or tell him how to set the "area" specification!

Is it possible to call this under program control, like in init.bsh? Something like:
LimitAreaFilter f = new LimitAreaFilter();
f.setArea(myArea);
engine.addFilter(f, 3);
davidekholm

Posts: 3,442
Registered: 18-Oct-2002
Re: LimitAreaFilter
Posted: 11 Apr 13, 14:47   in response to: JeffTucker in response to: JeffTucker
  Click to reply to this thread Reply
EarlyOut wrote:
EarlyOut wrote:
Interesting, though I'm not sure I grasp the utility of it. I'll have to mull over that one.

Now I see how that would be advantageous. I'm not sure I could explain it to a user, however, or tell him how to set the "area" specification!

Is it possible to call this under program control, like in init.bsh? Something like:

LimitAreaFilter f = new LimitAreaFilter();
f.setArea(myArea);
engine.addFilter(f, 3);

Yes, you can!
andreas-b

Posts: 3
Registered: 12-Apr-2013
Re: LimitAreaFilter
Posted: 12 Apr 13, 14:11   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
davidekholm wrote:
A user wished all images generated from jAlbum to stay at the same number of megapixels, i.e all to have the same area (width * height), no matter if the images fed are portrait, landscape or squary.

The user it's me :)

Thanks a lot David, that you felt inspired by my suggestion, and implemented the feature! :)

I'm not sure if there's any other photo album software out there, which is able to present photos in that way.

@earlyout

The benefit of the new function is purely esthetical.

In ordinary galleries a square photo (aspect ratio 1:1) is presented with an edge length, which is equal to the long edge of a portrait or landscape photo.
Therefore it has a much bigger area than its non-square neigbours.

That can be noticed as a form of emphasizing of square photos above others.

Inadequate, isn't it.

I made a mockup/sketch of a gallery with 3 photos:
http://borumat.de/iphone/flaechengleichheit-von-fotos

Another very straightforward suggestion relating to sizes:

Getting rid of fixed absolute sizes of photos.
Responsive webdesign is it :)

When a user likes to watch at high resolution photos (let's assume it is a camera with an aspect ratio of the sensor of 3:4) on a high resolution display (e.g 2560x1600) in a fullscreen mode at a high bandwith connection he wants the following sizes:

1600x1200 (landscape)
1200x1600 (portrait)
1386x1386 (square)

On a netbook (800x480) the needs are different.

The user wants the following sizes:

480x360 (landscape)
360x480 (portrait)
416x416 (square)

The server will render this sizes of pictures when it gets the first request.
Of course the rendered picture is cached on the server for a next request of the same size.

The client will load 4 pictures after the actual picture and 2 pictures before it, while the user watches photos in the gallery.
When the user swiches to the next photo, he will get it immediately without any delay.

That's my vision of a really smart online photo gallery :)
Size matters!

Of course a viewer of the gallery, who wants to see smaller photos to save bandwith can just choose that option on the startpage of the gallery.

JeffTucker

Posts: 8,039
Registered: 31-Jan-2006
Re: LimitAreaFilter
Posted: 12 Apr 13, 14:29   in response to: andreas-b in response to: andreas-b
  Click to reply to this thread Reply
Yes, once I saw what it does when you have a collection of "ordinary" landscape and portrait images, but with a couple of "squarish" images mixed in, I could see how this adjustment helps the aesthetics.

I think the easiest way to let a user control it is not through directly-entered area numbers, but perhaps through a JSpinner in the GUI to control the percentage of the image bounds area. For example, if he sets the image bounds at 1600x1600, and the "area limit" at 75%, a landscape image will be 1600x1200 - it's already right at 75% of the 1600x1600 image bounds area. The same for a 1200x1600 portrait image. But a 1600x1600 square image will be rendered at 1386x1386 (the square root of 1600*1600*0.75).

The skin code, of course, would take the image bounds and the "area limit" percentage and convert those into the "area" numbers to feed into the filter. In fact, to keep it simple, the skin could just automatically apply 75% to the image bounds based on the user choosing a checkbox labeled "Create equal area images." It gets trickier if the image bounds are not square, however. I'd have to think about that one....
davidekholm

Posts: 3,442
Registered: 18-Oct-2002
Re: LimitAreaFilter
Posted: 12 Apr 13, 14:46   in response to: andreas-b in response to: andreas-b
  Click to reply to this thread Reply
I'm glad you're happy with the addition Andreas,

Scaling the right size on the server side depending on what device the users has is a bit tricky with jAlbum as you're dealing with static web pages that have no server side logic, but one could fit an album with several differently scaled images and have the album pick the most suitable one for display.
andreas-b

Posts: 3
Registered: 12-Apr-2013
Re: LimitAreaFilter
Posted: 12 Apr 13, 15:14   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
davidekholm wrote:
Scaling the right size on the server side depending on what device the users has is a bit tricky with jAlbum as you're dealing with static web pages that have no server side logic,

I know.
That's why I called it a vision :)

Of course a really smart handling needs a server side software and a client side one.

but one could fit an album with several differently scaled images and have the album pick the most suitable one for display.

Yes. But I think it is smarter, when the size of display is recognized automatically by a software. That is a lot of manual and boring (configuration) work less for the creator and as well for the viewer of galleries.

Of course I know that such things are really complex.

A little note to the LimitAreaFilter:

It would be nice, if the software checks the whole content of a single gallery before it declares the sizes of pictures.
Because in gallery with just landscape photos they should all have the maximum size on the display.
Only if it is a mix of pictures with different aspect ratios the size should be restricted in the way I described.

Until know I didn't test your script, may be it treats a gallery like this yet.
Than please just discard my last comments :)
davidekholm

Posts: 3,442
Registered: 18-Oct-2002
Re: LimitAreaFilter
Posted: 12 Apr 13, 16:32   in response to: andreas-b in response to: andreas-b
  Click to reply to this thread Reply
No, it's not that smart, but do play with the sample project. I put it together in order to make it as easy as possible for you.
andreas-b

Posts: 3
Registered: 12-Apr-2013
Re: LimitAreaFilter
Posted: 14 Apr 13, 12:29   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
Hi David.
Thanks again for your interest.

I updated my sketch to make it easy to compare 3 different galleries.
http://borumat.de/iphone/flaechengleichheit-von-fotos
It shows, why it is important, that the script should "view" onto the gallery as a whole.

If somebody reads this thread, who speaks German, is very experienced with Jalbum and feels himself able to fill out the big table to compare different gallery tools, I would appreciate it very much, when you would contact me.
I like to add a column for Jalbum.

Most extensive table worldwide ;) to compare tools for online photo galleries:
http://borumat.de/iphone/vergleich-online-fotogalerien
Dschuwi

Posts: 296
Registered: 12-Nov-2003
Re: LimitAreaFilter
Posted: 28 Apr 13, 16:59   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
davidekholm wrote:

To support this request I've written the "LimitAreaFilter" which will be embedded in future jAlbum releases, but you can play with it right away (and embed in your skins if you wish).

Very, very cool!

Do I understand you right that this will be not included as a filter in future jAlbum releases, but rather under the Images > Image Bounds tab in the application itself? (I believe it would belong there).

I'm asking because if I implement it as a skin feature now, I wonder if it is worth the hassle, and, as a filter, it might then also interfere with the future jAlbum feature.
davidekholm

Posts: 3,442
Registered: 18-Oct-2002
Re: LimitAreaFilter
Posted: 29 Apr 13, 14:08   in response to: Dschuwi in response to: Dschuwi
  Click to reply to this thread Reply
Dschuwi wrote:
davidekholm wrote:

To support this request I've written the "LimitAreaFilter" which will be embedded in future jAlbum releases, but you can play with it right away (and embed in your skins if you wish).

Very, very cool!

Do I understand you right that this will be not included as a filter in future jAlbum releases, but rather under the Images > Image Bounds tab in the application itself? (I believe it would belong there).

I'm asking because if I implement it as a skin feature now, I wonder if it is worth the hassle, and, as a filter, it might then also interfere with the future jAlbum feature.


I don't think your use of this now will interfere with any future use of this filter by jAlbum itself. I don't think there is enough "popular demand" for this filter to become part of jAlbum's core set of filter or to make it into jAlbum's main settings.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums