I am quite new to using Inkscape and the pdf format. The situation is as follows: I have access to a collection of pdf files (of approx. 3mo each) containing a raster image of a rectangle section of a map, with additional indications around it. The total map is big, so there are many pdf files (around 20 let's say) and I would like assemble them.
Here is how I was planning to do: open an empty Inkscape project, import some pdfs inside the project (5 by 5 let's say), for each of the pdf, crop the "map section" (getting rid of titles and annotations), and then put them together to form a nice coherent map. Then import 5 new pdfs and continue untile done.
The issue is the following: although all pdf files are rather small (maximum 9mo), the Inkscape file quickly gets to 500mo for a reason I don't know. Obviously, the software ends up crashing eventually.
1) why does Inkscape count like 3mo + 3mo + 3mo + 3mo = 200mo ?
2) is there a way of Really forgetting data when I crop each pdf to keep the "map section" ? (cause I know that in secret, Inkscape keeps the data of everything I cropped)
3) is there a better way of doing what I'm doing with Inkscape ?
I agree with Tyler. Inkscape is not a great tool for manipulating bitmaps. However [Extensions > Raster > Crop] deletes pixels from your bitmap, rather than hiding them with a clip path.
As you discovered, some pdf encoders apply excellent bitmap compression algorithms. These images are decompressed when you import to Inkscape and the file size can increase dramatically. In this case a 2.2MB pdf expands to a 14.2MB svg. Mysteriously, when I [right-click > Extract Images...] the resulting png file is 10.6MB and the svg is 1.5KB.
On my mac I use ImageOptim to reduce bitmap file sizes. There are similar applications for Windows and Linux. Allowing some lossy compression [80% png quality] the 10.6MB file shrank to 3.8MB with no visible changes. Zooming both images shows perfectly preserved jpeg artifacts. I recommend stopping here but more compression is possible.
I loaded the 10.6MB png in Gimp then [Filters > Enhance > Wavelet-decompose...] [Scales: 7]. This creates 7 layers, each adding more detail to the underlying layers. Discard the top 2 layers. (Goodbye jpeg artifacts!) and merge the rest. Exporting yields a 7.4MB png with some blurring at high zoom levels.
8 bit RGB can encode 16777216 different colours for every pixel. Using fewer colours means more pixels share each colour, resulting in higher compression. Obviously, removing too many colours will ruin the image. In this case I tried [Image > Mode > Indexed...] [Maximum number of colours: 128] [Colour dithering: None]. The exported png came to 2.0MB. Using ImageOptim again reduced this to 1.8MB, and here I stopped.
Thank you so much for all the time you spent finding a way to help me, I appreciate it a lot !
There is a lot that I didn't know, now I will be able to try some more on my own. I have one question: when you "[right-click > Extract Images...]", what software are you using ? There is no such option when I use inkscape. Actually this is a problem that I have: I don't know a way of extracting the image in its exact dimensions, without loss.
Dear all,
I am quite new to using Inkscape and the pdf format. The situation is as follows: I have access to a collection of pdf files (of approx. 3mo each) containing a raster image of a rectangle section of a map, with additional indications around it. The total map is big, so there are many pdf files (around 20 let's say) and I would like assemble them.
Here is how I was planning to do: open an empty Inkscape project, import some pdfs inside the project (5 by 5 let's say), for each of the pdf, crop the "map section" (getting rid of titles and annotations), and then put them together to form a nice coherent map. Then import 5 new pdfs and continue untile done.
The issue is the following: although all pdf files are rather small (maximum 9mo), the Inkscape file quickly gets to 500mo for a reason I don't know. Obviously, the software ends up crashing eventually.
1) why does Inkscape count like 3mo + 3mo + 3mo + 3mo = 200mo ?
2) is there a way of Really forgetting data when I crop each pdf to keep the "map section" ? (cause I know that in secret, Inkscape keeps the data of everything I cropped)
3) is there a better way of doing what I'm doing with Inkscape ?
4) is my question actually understandable ?
Here is an example of one of the pdf files I'm working with. Its only 2.2mo but the raster has an exceptional quality somehow. https://capgeo.sig.paris.fr/PdfEtImages/AtlasAnciennesCarrieres/24-47/24-47_2004.pdf
ย
Thank you very much for your help !
elidiot
Since there is only an embedded raster/bitmap contained in the pdf, I'd use GIMP to open the PDFs and compile the images.
(Unless there is a compelling reason to use Inkscape...?)
I agree with Tyler. Inkscape is not a great tool for manipulating bitmaps. However [Extensions > Raster > Crop] deletes pixels from your bitmap, rather than hiding them with a clip path.
As you discovered, some pdf encoders apply excellent bitmap compression algorithms. These images are decompressed when you import to Inkscape and the file size can increase dramatically. In this case a 2.2MB pdf expands to a 14.2MB svg. Mysteriously, when I [right-click > Extract Images...] the resulting png file is 10.6MB and the svg is 1.5KB.
On my mac I use ImageOptim to reduce bitmap file sizes. There are similar applications for Windows and Linux. Allowing some lossy compression [80% png quality] the 10.6MB file shrank to 3.8MB with no visible changes. Zooming both images shows perfectly preserved jpeg artifacts. I recommend stopping here but more compression is possible.
I loaded the 10.6MB png in Gimp then [Filters > Enhance > Wavelet-decompose...] [Scales: 7]. This creates 7 layers, each adding more detail to the underlying layers. Discard the top 2 layers. (Goodbye jpeg artifacts!) and merge the rest. Exporting yields a 7.4MB png with some blurring at high zoom levels.
8 bit RGB can encode 16777216 different colours for every pixel. Using fewer colours means more pixels share each colour, resulting in higher compression. Obviously, removing too many colours will ruin the image. In this case I tried [Image > Mode > Indexed...] [Maximum number of colours: 128] [Colour dithering: None]. The exported png came to 2.0MB. Using ImageOptim again reduced this to 1.8MB, and here I stopped.
Thank you so much for all the time you spent finding a way to help me, I appreciate it a lot !
There is a lot that I didn't know, now I will be able to try some more on my own. I have one question: when you "[right-click > Extract Images...]", what software are you using ? There is no such option when I use inkscape. Actually this is a problem that I have: I don't know a way of extracting the image in its exact dimensions, without loss.
Thanks again.
Canยดt find it?
ย
Oh, I just had to degroup first. Thank you and sorry for my clumsiness.