Re: [Gegl-developer] Passing parameter to sampler from XML file

2009-07-11 Thread Geert Jordaens
On 11-07-09 03:47, Nicolas Robidoux wrote:
 Let me try to explain the motivation for having different methods for
 transformations which are tuned for upsampling on the one hand, and
 downsampling on the other, and why a one size fits all stylishly
 scheme is neither easy to put together nor likely to be fast.

 Practical explanation:

 If one wants a cheap upsize, bilinear is acceptable, and
 bicubic/lanczos are better. However, when used to downsample, these
 schemes behave almost like nearest neighbour, which sucks for
 producing thumbnails, for which variants of box filtering are way
 better. On the other hand, box filtering behaves like nearest
 neighbour when upsampling. This suggests that getting a single scheme
 which is great in both situations is not so easy.

 One can actually implement a more refined box filtering which is less
 nearest neighbour-like when upsampling. An example of such a scheme is
 nohalobox (see bugzilla) = downsharp/smooth. It's a good all around
 scheme, and it's reasonably cheap, but when upsampling it can't
 compete quality and speed wise with, say, Lanczos or upsharp.

 Bit more math:

 Locally, one can characterize transformations pretty well by
 considering the singular values of its Jacobian matrix (think of them
 as the absolute values of eigenvalues of the affine transformation
 which is the best approximation to the transformation at the point
 under consideration).

 Suppose now that one wanted to construct a scheme which does well in
 all circumstances. When both singular values are larger than 1: Use a
 good upsampling scheme. When both singular values are smaller than 1:
 Use a good downsampling scheme. What about all the other cases?
 Although it is possible to blend schemes, if the warp has a lot of
 variability accomodating both schemes will introduce artifacts and,
 more importantly, is likely to lead to a scheme which is slow in all
 circumstances.

 Hence, in my opinion, the need for a choice.

 --

 Now:

 A GUI with the purpose of image resizing could keep this issue
 invisible to users:

 If enlarging in both directions -  upsharp or upsmooth (a smooth
toggle could do)

 If shrinking in both direction -  downsharp or downsmooth

 If enlarging in one and shrinking in the other: Either make an
 educated guess based on which one is most representative, or use the
 up scheme first, and then the down scheme.

 However, the point of the samplers is that if and when perspective and
 complex warping are implemented in gegl, they won't skip a beat.

 Nicolas Robidoux
 ___
 Gegl-developer mailing list
 Gegl-developer@lists.XCF.Berkeley.EDU
 https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer



I do get the point that choosing the right sampler for the task or 
situation is not that straightforward.
However I think that the samplers should be callable using there 
technical name from the gegl lib.
Making the names more gimp user friendly, or implementing a scheme is 
more for the end user tool.
This way each tool that would use GEGL could implement he scheme most 
suitable for the tool.

Geert

___
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer


Re: [Gegl-developer] Passing parameter to sampler from XML file

2009-07-10 Thread Geert Jordaens
On 10-07-09 16:39, Nicolas Robidoux wrote:
 Most likely names of the resamplers at this point are either:

 upsharp and upsmooth

 or

 sharpupsize and smoothupsize

 for the samplers tuned for warps in which upsampling is more typical
 than downsampling (e.g., for image enlargement), and either

 downsharp and downsmooth

 or

 sharpdownsize and smoothdownsize

 for the samplers tuned for warps which mostly downsample (e.g., for
 producing thumbnails).

 -

 It turns out that the above schemes have cheap/less cheap
 versions. What I am thinking of doing is either prefixing or suffixing
 the above names with the word fast for the faster/lower quality
 versions, for example

 fastsharpupsize and fastsmoothupsize

 which would correspond to nohalo level 1 and snohalo level 1, while
 sharpupsize and smoothupsize would correspond to s/nohalo level 2.

 Feedback welcome.

 Nicolas Robidoux
 Laurentian University
 ___
 Gegl-developer mailing list
 Gegl-developer@lists.XCF.Berkeley.EDU
 https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer



I do not see any reason why one would have to specify up or downsize in 
the parameter since this can be determined from the in and output size, 
what about translations?

If the difference between FastSharpUpsize and SharpUpsize is qualty then 
it should not be named Fast,

FastSharp(Up|Down)size = SampleSharpGood = SharpGood
Sharp(Up|Down)size = SampleSharpBetter = SharpBetter

FastSmooth(Up|Down)size = SampleSmootGood = SmoothGood
FastSmooth(Up|Down)size = SampleSmootBetter = SmoothBetter

Or jus split it in 2 parameters, one for quality and one for effect.


Geert


___
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer


Re: [Gegl-developer] Passing parameter to sampler from XML file

2009-07-08 Thread Nicolas Robidoux

Suggestion implementing the s/nohalo family and the nohalobox family
without an explicit, visible, parameter:

Would it be possible/desirable to use the current code (which has a
parameter) as some sort of template?

Then, the nohalobox code would produce four independent samplers:

sharperbox - smoothing = 0
sharpbox - smoothing = 1/3.
smoothbox - smoothing = 2/3.
smootherbox - smoothing = 1.

which could be called like, say, linear.

And the s/nohalo code would produce four independent samplers:

sharper - nohalo (nohalo produces the same results as snohalo with smoothing = 
0, just faster)
sharp - snohalo with smoothing = 1/3.
smooth - snohalo with smoothing - 2/3.
smoother - snohalo with smoothing = 1.

Nicolas Robidoux
Universite Laurentienne
___
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer


Re: [Gegl-developer] Passing parameter to sampler from XML file

2009-07-08 Thread Øyvind Kolås
On Wed, Jul 8, 2009 at 8:43 AM, Nicolas
Robidouxnrobid...@cs.laurentian.ca wrote:
 Suggestion implementing the s/nohalo family and the nohalobox family
 without an explicit, visible, parameter:

 Would it be possible/desirable to use the current code (which has a
 parameter) as some sort of template?

Sure, for most uses both developers and users will desire a default
sampler that just works and needs no tweaking. Additional properties
to configure some of the samplers will make it harder both for users
of GUIs as well as developers implementing or using operations that
use the samplers. Fewer presets that cover normal use cases is
probably better than many; this trimming down of the presets might be
done in GUI layers code as well.

The names for samplers would need some serious thought, linear, cubic
and lanczos in current GIMP is already too techical for many users,
most people would have no clue what box refers to in the suggested
names. When exposes as for instance a drop down in the GUI these names
need to be translatable into other languages as well.


-- 
«The future is already here. It's just not very evenly distributed»
 -- William Gibson
http://pippin.gimp.org/http://ffii.org/
___
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer


Re: [Gegl-developer] Passing parameter to sampler from XML file

2009-07-08 Thread yahvuu
hi,

Nicolas Robidoux schrieb:
 Can you (yes, I mean you) think of better names?

uh, what, me?

i wouldn't want to be bothered with choosing different samplers
for up/down-scaling.

So just let me choose from matching pairs of samplers.
You know them better than i do...


greetings,
peter


___
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer


Re: [Gegl-developer] Passing parameter to sampler from XML file

2009-07-08 Thread Nicolas Robidoux

yahvuu writes:
  
  uh, what, me?
  
  i wouldn't want to be bothered with choosing different samplers
  for up/down-scaling.

(I'm surprised. You are always happy with the thumbnails you get?
Result after rotating an image? Maybe I'm too invested in this field
to know what matters and what matters not.)

Peter just gave me more ideas of how it could look in a menu:

bigger (sharp) and bigger (smooth)

and 

smaller (sharp) and smaller (smooth)

The fact that bigger can be used for arbitrary warps (including
downsampling) and smaller can be used for arbitrary warps (including
upsampling) should not confuse anyone. (I think.)

Keep the ideas coming!

Nicolas Robidoux
Laurentian University
___
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer


Re: [Gegl-developer] Passing parameter to sampler from XML file

2009-07-08 Thread Nicolas Robidoux

sharpEnlarge and smoothEnlarge

and

sharpShrink and smoothShrink (or sharpReduce and smoothReduce)

?

PS

Let me know if you'd rather I think about all this off list.
___
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer


Re: [Gegl-developer] Passing parameter to sampler from XML file

2009-07-08 Thread Nicolas Robidoux

sharpsmall and smoothsmall

and

sharpbig and smoothbig

?

In a scale image menu, the most likely appropriate method could be
chosen automatically (depending on the requested resizing), with an
extra smoothing toggle set by default to off.

Nicolas Robidoux
Universite Laurentienne
___
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer


Re: [Gegl-developer] Passing parameter to sampler from XML file

2009-07-08 Thread Øyvind Kolås
On Wed, Jul 8, 2009 at 1:08 PM, Nicolas
Robidouxnrobid...@cs.laurentian.ca wrote:
 PS

 Let me know if you'd rather I think about all this off list.

I dislike writing email, and you are almost using email like IRC, feel
free to continue but do not expect much response from me in particular
:d

/pippin


-- 
«The future is already here. It's just not very evenly distributed»
 -- William Gibson
http://pippin.gimp.org/http://ffii.org/
___
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer


Re: [Gegl-developer] Passing parameter to sampler from XML file

2009-07-07 Thread Øyvind Kolås
On Tue, Jul 7, 2009 at 10:25 AM, Nicolas
Robidouxnrobid...@cs.laurentian.ca wrote:

 Adam Turcotte and Eric Daoust are implementing samplers (alternatives
 to nearest neighbour, bilinear, bicubic, lanczos... interpolation),
 names snohalo1 (tuned for upsampling) and nohalobox (tuned for
 downsampling), which both have a natural parameter.  This parameter is
 basically the amount of extra antialiasing which is applied. The way
 the extra antialiasing is done is with a customized blurring operator
 in the case of snohalo1, and by enlarging the integration box (like
 for exact area box filtering) for nohalobox.

 Adam is nearly done (fingers crossed) implementing the paramter so
 that it is settable through xml commands.

 My question:

 We've settled on the name blur for this paramter, because for most
 people this is the visible effect, and I think most people understand
 that blurring can be useful to smooth out jaggies.

 Would you guys prefer another name for this visible parameter?
 Antialiasing, for example, seems like a good candidate, although it
 sounds a little too technical to my taste.

I would feel more comfortable if this parameter was not exposed, but
rather that sane presets were added and given names. In most cases the
additional properties of for instance a displacement map operation
might be visual and conceptual clutter getting in the users way. When
it comes to naming it; I think perhaps smoothing is a good candidate.

-- 
«The future is already here. It's just not very evenly distributed»
 -- William Gibson
http://pippin.gimp.org/http://ffii.org/
___
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer


Re: [Gegl-developer] Passing parameter to sampler from XML file

2009-07-07 Thread Nicolas Robidoux

Nicolas Robidoux writes:
  
  For example, nohalo1 (same result as snohalo1 with smoothing = 0, but
  runs faster) would be sharper, snohalo1 with smoothing = 1 would be
  smoother, and snohalo1 with smoothing = .5 would be halfandhalf,
  or something kind of like that?

If there were only four named presets, I supposed they could be

sharpest, sharp, smooth, smoothest

corresponding to smoothness = 0, 1/3, 2/3 and 1.

with the added bonus that smoothness = 1/3 kind of corresponds to the
Mitchell-Netravali choice of smoothing/interpolation balance.

Øyvind:

Does the above seem like a good choice, or did I change your mind with
my smoothness slider idea (or do you like neither)?

Nicolas Robidoux
Laurentian University
___
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer


Re: [Gegl-developer] Passing parameter to sampler from XML file

2009-07-07 Thread Adam Turcotte
On Tue, Jul 7, 2009 at 11:31 AM, Øyvind Kolåsislew...@gmail.com wrote:
 I would feel more comfortable if this parameter was not exposed, but
 rather that sane presets were added and given names. In most cases the
 additional properties of for instance a displacement map operation
 might be visual and conceptual clutter getting in the users way. When
 it comes to naming it; I think perhaps smoothing is a good candidate.

I decided to tentatively implement this using a type field as with
cubic. However, It appears to me that type is never actually set to
anything other than cubic during initialization.

How can I actually specify the type that I want to use?



Adam Turcotte
___
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer