Author Topic: Max Size For Export PNG ?  (Read 3304 times)

April 06, 2018, 04:00:53 AM
Read 3304 times

Gary68

  • Jr. Member

  • Offline
  • ***

  • 15
Hi,

Is it possible to export a valid PNG with a resolution greater than 65536 x 65536?

If I try to export my SVG at say 131072 x 131072 px, I to end up with an empty image. Lower resolutions seem to output ok.

Regards
  • 0.92
  • Windows 10

April 06, 2018, 12:04:47 PM
Reply #1

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Hi.

That...
sounds no computers could handle in the next 20 years.
As far as I know 40000 px is the max photoshop can theoretically handle at once.
Running on an i5 processor myself the largest images I ever worked on were these. -Images of A1 format @600 dpi=19866px/14047px if I can recall. But they were all greyscale, which means handling a single channel takes less resources.
Yet I experienced several crashes and getting an extra laptop cooler was a must.

No, you shouldn't export to such a large size -instead stick to saving into vector pdf format for printing.
Only possible reason one would want a raster copy is the use of filtering in the svg. However even then it is a good idea to slice the image up to smaller portions.

April 07, 2018, 01:05:23 AM
Reply #2

Gary68

  • Jr. Member

  • Offline
  • ***

  • 15
Hi,

Quote (selected)
As far as I know 40000 px is the max photoshop can theoretically handle at once.

Thanks for taking the time to reply, but photoshop can easily handle 262144 x 262144 so that isn't a problem for me.

Quote (selected)
However even then it is a good idea to slice the image up to smaller portions.

The reason I want to export the images is to do exactly that, is it possible to automate the export process using Inksape? If so then that's another option, but for now my original questions still stands :)
  • 0.92
  • Windows 10

April 07, 2018, 01:37:58 AM
Reply #3

Gary68

  • Jr. Member

  • Offline
  • ***

  • 15
Quote (selected)
is it possible to automate the export process using Inksape?

I see there is a command line option to export  :duh:
  • 0.92
  • Windows 10

April 07, 2018, 08:51:59 AM
Reply #4

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Out of curiosity, I tried exporting a 65536 x 65536  px square (with opaque fill).  It appears that Inkscape actually exported it, although it took 7 minutes.  However, after 3 minutes, windows is so far unable to display it!

Note that I have Windows 7 Pro, i7 processor, 16 gb ram.  Probably not the best graphics card, but not sure if that would be used to display a PNG??  (Now 7 minutes waiting for Windows to display it.)

Edit
After 10 minutes, cancelled Windows effort to display it.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

April 07, 2018, 09:07:01 AM
Reply #5

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
The reason I want to export the images is to do exactly that,

Do you mean to say that 131072 x 131072 px is the size of one of the slices?  If that's the case, then just make smaller slices. 

Or do you mean that you want to use some raster program to slice it up?

Also, as I re-read this thread, I wonder if you could be confused between size and pixel density?  Are you adjusting the DPI in Inkscape's Export PNG dialog, thinking that you are adding more pixels to it?  Inkscape works a little bit differently than you may expect.

When you change the dpi in the Export PNG dialog, all it does it make the image larger.  It's only after you print, when you set the size for the image, and then the pixels get compressed down.  Or load into a specific size of html "frame" on a webpage.

But, if that's not the case, then just ignore the last comments here  :)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

April 07, 2018, 02:27:00 PM
Reply #6

Gary68

  • Jr. Member

  • Offline
  • ***

  • 15
Quote (selected)
Out of curiosity, I tried exporting a 65536 x 65536 px square (with opaque fill).

Sorry I posted the wrong resolution, it should have been 16384 x 16384, that exports a valid png. But 32768 x 32768 for example performs the export as you say, but the result isn't a valid png. I haven't worked out what the max resolution is nor have I looked into why the png format is corrupt for larger files. Photoshop does handle larger png files so it isn't the image format AFAIK.

Quote (selected)
Do you mean to say that 131072 x 131072 px is the size of one of the slices?

No the end result is png tiles of 256 x 256. My original plan was to chop up a large PNG into those tiles using ImageMagick. But exporting the tiles straight from the SVG looks like the better option.

It would be nice to know the exact limitations of the export function, but for now I'm going with  --export-png & --export-area



  • 0.92
  • Windows 10

April 08, 2018, 01:44:40 AM
Reply #7

Gary68

  • Jr. Member

  • Offline
  • ***

  • 15
Quote (selected)
but for now I'm going with  --export-png & --export-area

Unfortunately this isn't practical atm, it takes me 2.5+ minutes to load and export a 256 tile via the command line, which is too long for the number of tiles I want to process. Exporting the tile from the inkspace GUI with the svg already loaded takes just a few seconds. But atm I can't get interactive mode to work never mind the things I want.
  • 0.92
  • Windows 10

April 08, 2018, 03:22:49 AM
Reply #8

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
No the end result is png tiles of 256 x 256.

In my humble opinion a 2560 px/2560 px tile should export fine. Probably a 5120 px/5120 px could be exported as well with no problem on the output, just too slowly.

Once you have separate tiles though, you'll face the rendering gap issue? If you don't merge the tiles into one large png.
Maybe it's a good idea to overlap the tiles with a few pixels then?

April 08, 2018, 03:49:34 AM
Reply #9

Gary68

  • Jr. Member

  • Offline
  • ***

  • 15
Quote (selected)
Once you have separate tiles though, you'll face the rendering gap issue?

Initial tests work well, the output tiles are being used with map libraries such as https://openlayers.org/ & http://leafletjs.com/.

The problem I have now is that Interactive mode isn't that much faster than the command line, for what I want to do. So now I'm onto extensions, I hope that doesn't lead to another deadend.
  • 0.92
  • Windows 10

April 08, 2018, 06:28:26 PM
Reply #10

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
I think we already have extensions for slicing up images.....  Would Extensions menu > Web > Slicer > Create a slicer rectangle....  meet your needs?

Let's see if there are some extensions which don't come installed with Inkscape....  Ok, I don't know if these work, or how they work, but you can investigate:

https://github.com/lee-b/svgslice
https://github.com/mattharrison/Inkscape-Slicer-Extension

Do you need instructions for installing extensions?

Edit
Still curious about "interactive mode" though.  Is that in a development version?
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

April 09, 2018, 12:41:15 AM
Reply #11

Gary68

  • Jr. Member

  • Offline
  • ***

  • 15
Quote (selected)
I think we already have extensions for slicing up images.

I took a look at Extensions > Export > Guillotine which does some thing very similar. But that looked as though it just used the same command line options and just loads the temp version of the svg for each operation.

Quote (selected)
Let's see if there are some extensions which don't come installed with Inkscape

Thanks for the suggestions, unfortunately they both use versions of the command line implementation to.
  • 0.92
  • Windows 10

April 09, 2018, 03:02:37 PM
Reply #12

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln

April 10, 2018, 01:49:52 PM
Reply #13

Gary68

  • Jr. Member

  • Offline
  • ***

  • 15
Thanks,

Looks interesting, not sure how you would define the xy coordinates for exporting, but it looks like it has potential. Certainly a better option than my current efforts to write a python script using pyAutoGui to automate the Inkscape front end interactions. While it exports in seconds, its a bit clunky :(
  • 0.92
  • Windows 10