Automatically trimming "down" the background layer based on the upper layer sizes

Here everybody can post his problems with PhotoLine
cadudesun
Mitglied
Beiträge: 19
Registriert: Di 14 Dez 2021 15:36

Automatically trimming "down" the background layer based on the upper layer sizes

Beitrag von cadudesun »

Hi. I'd appreciate your help.

As shown in the screen-recording (https://tinyurl.com/y27276nn), by using the command "Layout>Document>Trim Document", I can "increase" the background layer size automatically, according to the size of the upper layers.
Once the background layer size is increased, the command "Trim Document" doesn't work anymore when the area of the upper layers is "smaller" than the background layer.
I could use the "crop" tool to trim the background layer based on the upper layer sizes, but it is a process with a couple of steps, involving manually drawing an area firstly.
I'm wondering whether there is a command to automatically trim down the background layer based on the upper layer sizes, similarly to the "trim document" command (one-click command).

Thank you,
Cadu
Benutzeravatar
russellcottrell
Mitglied
Beiträge: 251
Registriert: Sa 26 Jul 2014 10:13
Wohnort: California

Re: Automatically trimming "down" the background layer based on the upper layer sizes

Beitrag von russellcottrell »

Another way, which may not be that much easier manually but would allow scripting, is to select the layer whose size the image is to be trimmed to, then use Layout - Document - Change Document Size; use the layer’s dimensions as the new document size, and the negative of the layer’s position as the new document position. When I do it, the position of the new image in the dialog display is incorrect for some reason, but the final result is correct.
Benutzeravatar
shijan
Mitglied
Beiträge: 1497
Registriert: Mo 23 Dez 2019 15:21
Wohnort: Ukraine

Re: Automatically trimming "down" the background layer based on the upper layer sizes

Beitrag von shijan »

In PhotoLine there is a "Picture Mode" and "Document Mode".
In "Picture Mode" The Background is your base. It defines borders of your image. So you can't trim less that newly generated larger sized background. In "Picture Mode" if you drag smaller layer to the bottom - it became your new background and will change image size. If you crop document "Picture Mode" - cropped pixels are gone forever.
"Picture Mode" may be considered as "basic" or "simple" mode. It is ok when you have image and some filters. But if you do some complex work, you need switch to "Document Mode"

"Document Mode" is sort of "unlimited mode" or "advanced" mode. It is like empty container. It allow any image manipulations, it will not crop pixels of the image when you crop document. It allow more advanced non destructive color management manipulations and many more other useful options.

So in your situation in "Picture mode" "Trim Document" command generates new background fill and can't opposite way because "Transparency" is disabled in Background layer attributes.
Bild

:arrow: In summary: Use transparent Background image in "Picture Mode". Or better switch to "Document Mode" and set any virtual color for background there in Document Attributes panel. So your background will remains white and will not affect real images during Trim. I really suggest do any more-less complex work only in "Document Mode"

Bild
PhotoLine UI Icons Customization Project: https://www.pl32.com/forum3/viewtopic.php?f=3&t=6302
Martin Huber
Entwickler
Entwickler
Beiträge: 4159
Registriert: Di 19 Nov 2002 15:49

Re: Automatically trimming "down" the background layer based on the upper layer sizes

Beitrag von Martin Huber »

"Trim Document" resizes the document (and in Picture Mode the background layer) to fit the size of the visible content of the document.

Just as shijan said: If the background layer doesn't have transparency, the resulting size will never be smaller.

In this case, you can use a trick: Turn off the visibility of the background layer, trim the document and turn it on again.

And if you don't really need a background layer, use the Document Mode.

Martin
cadudesun
Mitglied
Beiträge: 19
Registriert: Di 14 Dez 2021 15:36

Re: Automatically trimming "down" the background layer based on the upper layer sizes

Beitrag von cadudesun »

Many thanks to all of you for the detailed explanations.
To toggle from picture to document mode (under Document Attributes panel) is so convenient!