Upsizing images -- that would be nice!

Here everybody can post his problems with PhotoLine
Benutzeravatar
greenmorpher
Mitglied
Beiträge: 943
Registriert: Di 29 Mai 2007 14:42
Wohnort: Rabaul, Papua New Guinea

Upsizing images -- that would be nice!

Beitrag von greenmorpher »

I'm just looking at a thread on the DPReview Mac forum where someone is talking about increasing image size by increasing pixel numbers. And it struck me that PL should be able to do this -- if it could do this well, it would be a huge boost for it.

Since adding in pixels is basically a matter of adding pixels between pixel A and pixel B taking into account the environment, I wonder whether the underlying tools are already in hand with the repair and removal brushes which use the environment to make an approximation of what was/is/should be there?

I know that I have simplified the notion to a laughable degree here -- but I do want to increase the pixel count in some images and I don't want to spend twice the price of PL for a plug-in.

Cheers, geoff

Geoffrey Heard
Business & Environment Writer, Editor, Publisher
The Worsley Press
Benutzeravatar
Hoogo
Beta Tester
Beiträge: 4169
Registriert: So 03 Jul 2005 13:35
Wohnort: Deutschland

Re: Upsizing images -- that would be nice!

Beitrag von Hoogo »

Your description sounds like a simple "scale layer", obviously available in any program for decades now. Can you post a link to that thread?
Benutzeravatar
greenmorpher
Mitglied
Beiträge: 943
Registriert: Di 29 Mai 2007 14:42
Wohnort: Rabaul, Papua New Guinea

Re: Upsizing images -- that would be nice!

Beitrag von greenmorpher »

Not too simple, Hoogo -- we are talking $200 plug-ins here.

http://forums.dpreview.com/forums/read. ... e=40152993

Cheers, geoff
Benutzeravatar
Hoogo
Beta Tester
Beiträge: 4169
Registriert: So 03 Jul 2005 13:35
Wohnort: Deutschland

Re: Upsizing images -- that would be nice!

Beitrag von Hoogo »

Well, it is THAT "scale layer"-topic, as always :)
Discussions about upscaling always contain lots of "magic", good and bad results are hard to measure, and what looks good on some pieces of one picture may look bad on another picture.

For PL and photographies I would use Lanczos 3, but for some purposes "linear" or even "quick" are better.
Outside of PL there are a lot of tools, ideas and programs that try to achieve good results. There are even special algorithms for upscaling 8Bit-computergraphic! But as always: If there is a program using that algorithm, it's most of the time for Windows.

Comparison with pictures in a german forum. Maybe you have to be registered to see the pictures, but still you might find some useful links.
A newer duscussion in the same forum. Seems that sometimes Lanczos3, sometimes Smilla enlarger (win only?), sometimes a wiener filter in image analyzer (win only) or a tension-algorithm used in gmic (maybe mac, too?) give the most pleasing results.
Benutzeravatar
greenmorpher
Mitglied
Beiträge: 943
Registriert: Di 29 Mai 2007 14:42
Wohnort: Rabaul, Papua New Guinea

Re: Upsizing images -- that would be nice!

Beitrag von greenmorpher »

What are you saying, Hoogo, that scaling up in PL using Lanzcos 3 will produce equal or better results than with the dedicated plug-ins -- which are touted as far superior to P'shop's scaling? (I know nothing about P'shop's scaling; I haven't worked in it since P'shop 5.5 and I can't remember ever having to scale up).

I thought Lanzcos 8 was the highest quality of the alternatives offered by PL. :?:

Cheers, geoff
bkh
Beta Tester
Beiträge: 3687
Registriert: Do 26 Nov 2009 22:59

Re: Upsizing images -- that would be nice!

Beitrag von bkh »

greenmorpher hat geschrieben:What are you saying, Hoogo, that scaling up in PL using Lanzcos 3 will produce equal or better results than with the dedicated plug-ins -- which are touted as far superior to P'shop's scaling? (I know nothing about P'shop's scaling; I haven't worked in it since P'shop 5.5 and I can't remember ever having to scale up).

I thought Lanzcos 8 was the highest quality of the alternatives offered by PL. :?:

Cheers, geoff
Really depends on how you define "better". "Bicubic" and "Lanczos" are pretty faithful: they only scale what they "see". All of the more sophisticated algorithms try to guess what may have been in the picture, and then add "details" which create the impression of sharpness. Most try to guess where there are edges and add sharp edges in the enlarged image. Fine if there was an edge there in reality, but if it was just a noise pattern, you end up with ugly artifacts. Once I've tried one of these "miracle" algorithms on an image with a mountain in the dust which was covered by a forest. In the enlarged image, the forest was gone … I'm not saying that these algorithms are bad, but imo, they aren't "general purpose".

Cheers

Burkhard.
Benutzeravatar
greenmorpher
Mitglied
Beiträge: 943
Registriert: Di 29 Mai 2007 14:42
Wohnort: Rabaul, Papua New Guinea

Re: Upsizing images -- that would be nice!

Beitrag von greenmorpher »

Okay -- so that as about what I expected; they would work better on stuff with bolder features or not much features at all. Fine for a face, less good for hair, perhaps.

By Bicubic or Lanzcos 3 or 8, do they add pixels? If so, on what basis?

I have a need from time to time to add pixels.

Cheers, geoff
Andre
Mitglied
Beiträge: 83
Registriert: Sa 29 Sep 2007 14:08

Re: Upsizing images -- that would be nice!

Beitrag von Andre »

greenmorpher hat geschrieben: By Bicubic or Lanzcos 3 or 8, do they add pixels? If so, on what basis?
Cheers, geoff
Yes, they add (guess by algorithm) pixels.

You'll find a descprition of Lanczos here:
http://en.wikipedia.org/wiki/Lanczos_resampling

and for bicubic here:
http://en.wikipedia.org/wiki/Bicubic_interpolation

Best wishes
Andre
Benutzeravatar
Hoogo
Beta Tester
Beiträge: 4169
Registriert: So 03 Jul 2005 13:35
Wohnort: Deutschland

Re: Upsizing images -- that would be nice!

Beitrag von Hoogo »

All upscaling algorithms add pixels, no matter if it's a "faithful" algorithm or a "sophicticated".

Imagine a picture of 3*3 pixels. Every pixel has a coordinate, it's displayed in the status bar of photoline when you move with the cursor along the picture. They are numbered from 0 to 2. Only natural numbers are possible, there's no pixel at coordinate 1.2345!
Now imagine that you want to rescale it to 6*3 pixels. Now ignore that only natural numbers are possible and look what pixels you would find at 0/0, 0/0.5, 0/1, 0/1.5, 0/2, 0/2.5.

For the "faithful" algorithms:
0/0, 0/1, 0/2 are easy, just take that pixels from the original.
All other pixels are calculated by using a weight function. Look at the surrounding pixels, calculate their distance and use the weight function to give that pixel a weight in the result. You want to know what the color of 0/0.5 would be? Take 0/0, distance is -0.5, its weight is 0.5. Take 0/1, distance is 0.5, so its weight is also 0.5. That's how bilinear works.

You could draw a graph of that function, it would look like an upside-down "V"

For nearest neighbor (or fast as it is called in PL) this weight function is: Everything with a distance from -0.5 to 0.5 weights 100%, everything else weights nothing.

A graph would show a rectangle.

Bicubic has a function that goes from -2 to 2, it's graph looks like a bell.

Lanczos at least from -3 to 3, I think it's window size depends on the kind of lanczos. And the graph of that function looks quite funny, it's sort of a mixture between bell and a wave that even gives a negative weight to some distances.

For that "tricky" upscaling by 10%, sharpening the result, upscale by 10% again and so on you could try to find such a function, too. That would result in a different function for every pixel, hard to predict...

(Idea for programmers: As people still like that tricky scaling, adding some kind of randomness to the weight functions might give pleasing results! I have to try that someday.:))

The "sophisticated" algorithms basically also try to guess what a pixel at 0/0.5 would be, but there's no simple formula that weights the neighboring pixels. Most of them look as if they turn the raster graphics into some kind of vector-graphics. Sometimes that looks good, sometimes it's a mess.

Well, Andre already gave you some links, I hope that all those descriptions aren't too mathematical.
Benutzeravatar
greenmorpher
Mitglied
Beiträge: 943
Registriert: Di 29 Mai 2007 14:42
Wohnort: Rabaul, Papua New Guinea

Re: Upsizing images -- that would be nice!

Beitrag von greenmorpher »

Great. Thanks, Hoogo. You’re a handy teacher. And with the links Andre's given, I'm getting a better understanding.

Cheers, geoff