Merging layers or converting to RGB image lowers resolution of pdf file

Here everybody can post his problems with PhotoLine
Paolo
Mitglied
Beiträge: 6
Registriert: Sa 15 Aug 2015 16:49

Merging layers or converting to RGB image lowers resolution of pdf file

Beitrag von Paolo »

Hello,
I'm having a trouble working on a .pdf file and I just don't know how to handle it.
The pdf file appears to be made of many layers (text, vector, other groups) but I need to turn it into a simple raster file (es. .jpg).
I tried two different ways:
- select all of the layers in the pdf file -> merge layers
or:
- convert layer -> group to RGB image.
The problem is, the converted file has much a lower resolution than the original. I post a couple of screenshots (before / after the conversion).
Any suggestions? I can provide the the original file, which is quite large (about 50 MB).
Thanks

Paolo
Before the conversion
convert_group_before.jpg
After the conversion
convert_group_after.jpg
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: Merging layers or converting to RGB image lowers resolution of pdf file

Beitrag von Hoogo »

Can you check the resolution of the layer at the bottom and of the document? The resolution of the result should depend on one of them.
----------------
Herr Doktor, ich bin mir ganz sicher, ich habe Atom! /Doctor, doctor, I'm sure, I've got atoms!
Paolo
Mitglied
Beiträge: 6
Registriert: Sa 15 Aug 2015 16:49

Re: Merging layers or converting to RGB image lowers resolution of pdf file

Beitrag von Paolo »

Hi,
I open the .pdf file by double-clicking it in the browser, so it's the only layer in the document. The resolution shown in the document properties windows resolution is 300 dpi.
Apparently the resolution of the file is the same before and after the conversion, both as dpi and pixel (image is about 13.000 x 12.000 pixel 300 dpi). But when you look at it its resolution "seems" lower after the conversion.
Inthe past I used to work with these files with other applications (i.e. The Gimp) with no problems, so I guess I'm doing something wrong here. Still new to Photoline.
Paolo
Mitglied
Beiträge: 6
Registriert: Sa 15 Aug 2015 16:49

Re: Merging layers or converting to RGB image lowers resolution of pdf file

Beitrag von Paolo »

Hi,
I uploaded one of the .pdf files I'm talking about on Dropbox. It is available for download at the following link:
https://dl.dropboxusercontent.com/u/136 ... _347_B.pdf

Can anybody show me a way to "flatten" it using Photoline without resolution loss?
Thanks
Paolo
Benutzeravatar
Hoogo
Beta Tester
Beiträge: 4169
Registriert: So 03 Jul 2005 13:35
Wohnort: Deutschland

Re: Merging layers or converting to RGB image lowers resolution of pdf file

Beitrag von Hoogo »

I flattened, and it looked fine...

Other things I've seen in this document:
When you look at the attributes of all the inner layers of the graphic, then they have rather strange positions, for example x= 163.9 px, y= 9142.2 px. That would be a good reason that everything looks soft when flattened, maybe other pictures have other values?
But for this kind of graphic I think the result will be fine when you disable anti-aliasing before flattening.
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
----------------
Herr Doktor, ich bin mir ganz sicher, ich habe Atom! /Doctor, doctor, I'm sure, I've got atoms!
Paolo
Mitglied
Beiträge: 6
Registriert: Sa 15 Aug 2015 16:49

Re: Merging layers or converting to RGB image lowers resolution of pdf file

Beitrag von Paolo »

Hi, thanks for taking time to help with my problem. I don't know why I didn't try going the easy way first.
I wanted to understand what was going on, so I did a little more experimenting and tried:

- "flatten image": works well
- select the main group -> "merge layers" : works well
- select all of the layers within the main group -> "merge layers": image is corrupted, low res and unusable.

So, while I still don't understand exactly what was going on, I'm happy that my problem is solved.
Regards
Paolo
Benutzeravatar
Hoogo
Beta Tester
Beiträge: 4169
Registriert: So 03 Jul 2005 13:35
Wohnort: Deutschland

Re: Merging layers or converting to RGB image lowers resolution of pdf file

Beitrag von Hoogo »

Paolo hat geschrieben:- select all of the layers within the main group -> "merge layers": image is corrupted, low res and unusable.
Yes, I can confirm that. I selected all the layers within the "interesting" group, starting with the cyan circle.

Copying them into a new document with Ctrl+C, Ctrl+E and then flattening or merging them looks good.
Merging them directly looks bad, the result is scaled to 416%.

The first layers in the group are scaled to 416%, some are even mirrored, seems that this also determines the scaling of the final bitmap. Still interesting why this doesn't happen when the layers are copied to a new document.
----------------
Herr Doktor, ich bin mir ganz sicher, ich habe Atom! /Doctor, doctor, I'm sure, I've got atoms!
Benutzeravatar
Herbert123
Mitglied
Beiträge: 2452
Registriert: Sa 12 Mai 2012 21:38

Re: Merging layers or converting to RGB image lowers resolution of pdf file

Beitrag von Herbert123 »

No need to copy any files to achieve a perfect flattened version.

Here is what you do:
0) delete that vector layer at the top. This represents the crop of the pdf.
1) right-mouse click on the name area of the layer. Select "Fix Layer".
2) open the document properties, and activate pixel alignment "alignment" [beta version!]
3) Flatten the image.

That is it. So what was happening to the conversion before?

a) the pdf opens in document mode. The map layer was scaled to 400% by the original creator. Photoline remains aware of these transformations, but in this case it converts the map to a lower resolution. This results in a fuzzy looking map. By fixing the group, you make certain the conversion happens at 100%: full resolution. Check the layer properties scale values: after fixing, they become 100%. Before fixing, they are set to 416.7%. Also note the image size: four times the pixels!

Coincidentally, right-mouse clicking the word "scaling" also gives you the fix layer option.

b) As Hoogo points out, the group itself, and all the embedded layers are positioned at decimal positions. When you convert to a flattened version, this will result in unwanted anti-aliasing - especially in this case, since all the bitmaps are non-antialiased to begin with. Unwanted grey pixels will be introduced after flattening or conversion of the group to a RGB layer.

To avoid unwanted anti-aliasing artifacts, you must align all the layers to exact pixel values. The newer beta version will do this for bitmap layers as well (the current official version's pixel alignment only works with vector layers), so you will have to get the latest beta version. Or do it manually by typing the x and y location. This is a beautiful example of why pixel alignment can be so important to have. So just download the beta.

c) You might be wondering why an image editor allows for decimal values. Well, do not forget that Photoline also offers a number of DTP features, and export to PDF. That is the reason why decimal values are allowed. But cases like these also drive the point home why a pixel alignment option may be quite essential to have.

d) the original creator of this map scanned the original file at 1bit (b&w) at a higher resolution, and used 1bit drawing tools (or at least, the original application converted those curves to 1 bit, non-antialiased lines. The purple lines and text were possible added later, is my guess: those are vector, and convert nicely anti-aliased. If that is unwanted, turn off anti-aliasing in Photoline before doing the flattening.

When you zoom in, you can tell that the map's details are lost, and look rough. That is not Photoline's fault. You can check in any pdf viewer, and you will note the same bad quality. This is caused by the scan quality, which is not that great. A greyscale scan at the same resolution would have resulted in a much improved visual quality, and kept more detail.

Hope this helps your understanding.
/*---------------------------------------------*/
System: Win10 64bit - i7 920@3.6Ghz, p6t Deluxe v1, 48gb (6x8gb RipjawsX), Nvidia GTX1080 8GB, Revodrive X2 240gb, e-mu 1820, 2XSamsung SA850 (2560*1440) and 1XHP2408H 1920*1200 portrait
Martin Huber
Entwickler
Entwickler
Beiträge: 4298
Registriert: Di 19 Nov 2002 15:49

Re: Merging layers or converting to RGB image lowers resolution of pdf file

Beitrag von Martin Huber »

Paolo hat geschrieben:- "flatten image": works well
- select the main group -> "merge layers" : works well
- select all of the layers within the main group -> "merge layers": image is corrupted, low res and unusable.

So, while I still don't understand exactly what was going on, I'm happy that my problem is solved.
"Merge Layers" creates a layer that has the same transformation as the group, that contains the layers. In your sample document the group is scaled up and flipped vertically, so the resulting image layer will be scaled up and flipped, too.
This is mostly a problem with imported PDF files, because PDF has a base resolution of 72 dpi and a bottom-up coordinate system, while PhotoLine usually has a base resolution of 300 dpi and a top-down coordinate system.

I am currently considering creating the image in this situation using the document resolution (instead of the group transformation), but right now I can't say whether there will any drawbacks. Opinions are welcome.

Martin
Paolo
Mitglied
Beiträge: 6
Registriert: Sa 15 Aug 2015 16:49

Re: Merging layers or converting to RGB image lowers resolution of pdf file

Beitrag von Paolo »

Wow, this started as a simple help request and ended as a great way to learn lots of interesting things!
Some of these are concepts quite new to me, so I've still lots to learn / meditate about!
Really thanks for the deep explaination of what was going on!
Regards
Paolo