Saving to PNG

Here everybody can post his problems with PhotoLine
RobS
Mitglied
Beiträge: 47
Registriert: Di 11 Mai 2010 03:51

Saving to PNG

Beitrag von RobS »

Hi,

I'm confused here, and achieving awful results as well... the two are probably connected.

I have a file (191x191) with a number of layers that include a background 'matte', picture frame and then a selection of photos to go into the frame.

In photoshop I would 'save for web', select the output format and parameters, preview and save. Adjusting parameters comes with live feedback and I can select which colours to set transparent (8 bit) or use full 24-bit for a proper alpha mask. The estimated size at preview is pretty accurate. In the test case the png saved through photoshop was estimated and resulted in a PNG (8bit) of some 25KBytes

In photoline I can 'save as...' select PNG (I can't choose 8 vs 24 bit directly) and mess with parameters as best I can (guesswork) and preview by pressing the preview button, and save. The best estimated size I've achoeved is 32KBytes, but when saved it results in a file of 98KBytes, and the result is awful, especially the edges of transparent/non-transparent.

When trying to set transparencies I have no idea of what I'm doing, but I'm coming to the conclusion that I would be perhaps better off setting this all up with adjustment layers before attempting to output to PNG (or GIF).

Granted, I'm including photo layers with 24bit colour. Photoshop handles the reduction to a 256 colour palette easily and intuitively within the 'Save for Web' UI. I don't see the same ease at all within photoline, quite the opposite. Do I need to manually setup each layer first? How do I get rid of jagged edges to transparency?

I'm sufficiently impressed with the rest of photoline to know that what I want to achieve is certainly achievable and that it is most likely my not understanding/seeing a more complex workflow and will quite probably kick myself when I do see it. But I do wonder why I cannot work it out from the interface, and why the final output is near three times the estimated size.

Lastly, and this seems really absurd, when I do save the file as a png it remains open (as expected) with all layers present and correct (as expected), but the name at the top of the window is now the name of the saved png file (certainly not expected)! Why? PNG files don't have layers, and the original layered file does not have a '.png' extension, so this is misleading/confusing at best.

The whole workflow for generating graphics (with reliable smooth transparency where needed) for web is crucial for me, and I just don't currently have any sense of control at all.

Any pointers gratefully received.

Rob
RobS
Mitglied
Beiträge: 47
Registriert: Di 11 Mai 2010 03:51

Re: Saving to PNG

Beitrag von RobS »

Ok, now found the web export option and it does a much better job than saving PNG via 'Save As…' and nearly as good as with photoshop.

One question though, when using diffusion error as the means to reduce colours, is there any means of controlling how that is calculated. I ask because I'm getting point noise in the sky in the PNG from photoline, which I don't get from the photoshop generated one. this is in an area where a blue sky approaches a white cloudline and is as if the radius used to calculate the diffucion error in photoline is larger that the radius in photoshop (if that makes sense). The transition distance between different shades are larger in PL than in PS, meaning that the clouds are having an adverse effect in the blue sky area above, leading to what looks like point noise (see zoomed extracts below).

Bild

Cheers


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

Re: Saving to PNG

Beitrag von Hoogo »

You could try to use a different palette when you arte in the "reduce clolors" dialog. Most of the times "optimized median cut" will give the best results, but sometimes "Octree" looks fine, too. You could also change some colors in this palette by hand and add some more blue tones, but I guess this would be too much tweaking.
bkh
Beta Tester
Beiträge: 3687
Registriert: Do 26 Nov 2009 22:59

Re: Saving to PNG

Beitrag von bkh »

I don't think that error diffusion is the culprit here - usually, error diffusion proceeds from top to bottom and left to right and only "looks" at neighbouring pixels. (Anyway, my guess would be that PL uses Floyd Steinberg here, since otherwise it would be missing from that list.)

I'd rather suspect a palette issue here. Which palette did you choose in the palette tab? Did you try building one from the image? Are the PS and PL pic using the same palette?

EDIT: The following DOESN'T WORK. PL seems not to do colour reduction in Lab mode.
Just one last idea: have you tried converting your pic to the Lab colour space before reducing color? This might help PL compute a better palette. (Afaik, PS always computes in Lab anyway.)

Cheers

Burkhard.

P.S. If you like, attach your pic to a forum post. Then it's easier for others to actually try out their suggestions.
RobS
Mitglied
Beiträge: 47
Registriert: Di 11 Mai 2010 03:51

Re: Saving to PNG

Beitrag von RobS »

Thanks for the suggestions... I've checked through what I've done.

This is using the web export option under the web menu
Selected PNG as the output format and reduce colours from the PNG settings. These I have changed to:

No preset
256 colours
Error diffusion

Under colour the palette is loaded from the image itself.

Attempting anything else gives worse results.

How do I attach a file... neither .PLD nor .PSD extensions are allowed!
Benutzeravatar
Hoogo
Beta Tester
Beiträge: 4169
Registriert: So 03 Jul 2005 13:35
Wohnort: Deutschland

Re: Saving to PNG

Beitrag von Hoogo »

RobS hat geschrieben:Under colour the palette is loaded from the image itself.
If I remember correctly, loaded means that there is a "special" palette present. Usually that's when you alter a somehow else created palette, but I'm not sure at the moment...
RobS hat geschrieben:How do I attach a file... neither .PLD nor .PSD extensions are allowed!
Zip is accepted, so if you could zip the file, an upload should work.
RobS
Mitglied
Beiträge: 47
Registriert: Di 11 Mai 2010 03:51

Re: Saving to PNG

Beitrag von RobS »

product-thumbsmin.pld.zip
Unable to get the file, even zipped, below the 128K maximum attachment size... so I've had to crop it, which may affect palette.
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
Benutzeravatar
Hoogo
Beta Tester
Beiträge: 4169
Registriert: So 03 Jul 2005 13:35
Wohnort: Deutschland

Re: Saving to PNG

Beitrag von Hoogo »

Yes, the automatic palettes don't look very nice :(
After addins some more blue tones to the palette by hand the result looks better, but there are still some far-off pixels.
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
RobS
Mitglied
Beiträge: 47
Registriert: Di 11 Mai 2010 03:51

Re: Saving to PNG

Beitrag von RobS »

Thanks for the try.

I think my earlier attempt was near as close as it's possible to get without manual intervention.

Generating the palette from the image itself (which is what I did) looks very close to what is achievable with 'optimized Octree' colour reduction. Changing to 'optimized median cut' removed the paler spot noise near the cloud boundary, but introduced more dark spotting above that near to the rice tips. Swings and roundabouts, and if I had to choose I'd prefer the one derived from the image itself, or the Octree.

Looking closely the PL version does very well in areas of detail, but produces clearly more noise in areas of slight tonal gradient.

Photoshop has more controls in that it's possible to choose from 'diffusion', 'pattern' or 'noise' as the basic colour dither, and in the case of 'diffusion' then also set a percentage. EDIT: This percentage setting seems to affect the size of the transition zones between adjacent tones. 0% produces the same result as 'nearest colour', while 100% yields the result shown in the photoshop output. Would/could that be a possible addition/enhancment here?

In DL the reduction methods other than 'error diffusion' and 'nearest colour' all insert objectionable patterning to what should be smooth areas, and nearest colour produces severe banding.

I've tried extracting the palette from photoshop, but PL doesn't understand the .ACT format of photoshop colour LUTs... unless someone knows of a workaround.

Tough to know what photoshop is doing to get the result it does. PL comes close, but the transitions between tonal bands in the sky are clearly broader (circa 16-20 pixels at a guess) in PL than they are in PS (circa 6-8 pixels).
bkh
Beta Tester
Beiträge: 3687
Registriert: Do 26 Nov 2009 22:59

Re: Saving to PNG

Beitrag von bkh »

Just out of curiosity, I tried what happens if you construct the colur palette using MedianCut in Lab mode. The idea is that distances between Lab colours represent colour differences better than differences in RGB, so that MedianCut makes better choices.
Here's what I get.
product-thumbsmin.png
As far as I can see, this is quite similar to the PS result.

Unfortunately, this doesn't work by just converting the image to Lab mode and applying colour reduction. (Maybe we could convince the PL developers to support this. :mrgreen: )

Instead, one has to copy the L, a and b channels into the R, G, B channels of another layer, then apply the color reduction to that RGB layer, and move the R, G, B layers back to the L, a, b channels. If anyone is interested, I can post some actions to achieve this.

Cheers,

Burkhard.
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
RobS
Mitglied
Beiträge: 47
Registriert: Di 11 Mai 2010 03:51

Re: Saving to PNG

Beitrag von RobS »

bkh hat geschrieben:Unfortunately, this doesn't work by just converting the image to Lab mode and applying colour reduction. (Maybe we could convince the PL developers to support this. :mrgreen: )
I tried doing just that without success... but then also wasn't sure of whether I'd actually converted to Lab correctly (I'm still learning PL!!).

Personally I'd think this is the sort of behind the scenes two-way transform that PL should be handling, especially if it produces better results, as appears here to be the case... Perhaps even making it the default mode of operation for colour reduction, but with the option to turn it off, so that it's done on the fly, with the image returned to its original colour space afterwards. How do we ask for such an enhancement, or can that be assumed by discussing it here?
bkh hat geschrieben:Instead, one has to copy the L, a and b channels into the R, G, B channels of another layer, then apply the color reduction to that RGB layer, and move the R, G, B layers back to the L, a, b channels. If anyone is interested, I can post some actions to achieve this.
Please do... Would welcome the extra accessibility such would provide.
bkh
Beta Tester
Beiträge: 3687
Registriert: Do 26 Nov 2009 22:59

Re: Saving to PNG

Beitrag von bkh »

RobS hat geschrieben:Please do... Would welcome the extra accessibility such would provide.
The attached zip archive contains three actions, you'll have to load all three of them using the "merge actions" command (Action dialog, context menu).

If you run "Colour reduction in Lab mode", it will create a new layer with all the content of the document, and perform a colour reduction on the new layer. While running, the colour reduction dialog will open, so that you can choose the number of colours. I recommend using "MedianCut" for the palette and leaving "color from all levels" unchecked. If you save the result as .png, remember to use colour reduction there as well (best colour will do), since PL is not automatically aware that the pic has 256 colours.

The other two actions are used by the first one, they copy the L, a, b channels of one layer into the R,G,B channels of a new one and back, respectively.

Hope it works for you. I'd be curious to know how well it performs on other images.
RobS hat geschrieben:Personally I'd think this is the sort of behind the scenes two-way transform that PL should be handling, especially if it produces better results, as appears here to be the case... Perhaps even making it the default mode of operation for colour reduction, but with the option to turn it off, so that it's done on the fly, with the image returned to its original colour space afterwards. How do we ask for such an enhancement, or can that be assumed by discussing it here?
Usually, the developers of PL follow discussions on the forum. Probably wouldn't hurt if a few people reported that Lab mode colour reducction works better for them. :) If my macros work for you, I'll probably post them in the "Tips and Tricks" section of the forum as well.

Cheers,

Burkhard.
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
RobS
Mitglied
Beiträge: 47
Registriert: Di 11 Mai 2010 03:51

Re: Saving to PNG

Beitrag von RobS »

Thanks... I'll let you know how it goes.

Is there any particular folder in which I should place the files in question? Should they be in their own sub-folder? Or just load them from anywhere?

Still feeling my way here!

Cheers

Rob
bkh
Beta Tester
Beiträge: 3687
Registriert: Do 26 Nov 2009 22:59

Re: Saving to PNG

Beitrag von bkh »

RobS hat geschrieben: Is there any particular folder in which I should place the files in question? Should they be in their own sub-folder? Or just load them from anywhere?
Just put them wherever you want. PL saves them in the preferences, along with the other actions. You can even delete the files after loading them into PL.

Cheers

Burkhard.
Benutzeravatar
Hoogo
Beta Tester
Beiträge: 4169
Registriert: So 03 Jul 2005 13:35
Wohnort: Deutschland

Re: Saving to PNG

Beitrag von Hoogo »

Cool actions :D
When thinking about it it comes to my mind that Lab is the better color space for this job, as it is based on perception and has equal distances between its colors.