[Ipe-discuss] Importing an IPE document to a png file of fixed dimensions

Lluís Alemany-Puig lluis.alemany.puig at upc.edu
Mon Mar 7 09:32:52 CET 2022

Hello again,

Thank you for the advice!

I'm happy with the command line, yes. I can't shake the feeling, 
however, that "72" is the new "42". Perhaps some kind of pop up menu for 
the "Export to png" would be helpful. It could have options like "output 
size", or an option to choose the zoom level in that menu, rather than 
using tacitly.

I did what you suggested about using the presentation style. It changed 
the font family and I think it will make the text easier to read. But 
perhaps it will change. I still made a whole new style sheet though, 
with a bunch of new colors, grid size, line thicknesses that I borrowed 
from a course's slides that I took some time ago (the slides having been 
made with IPE).

I do not think that shrinking the layout to half the size is a good 
thing at this point, given that I don't know how much information I'll 
put in there.

Thanks for your time and for IPE,


On 06/03/2022 10:39, Otfried Cheong via Ipe-discuss wrote:
> On Sun, Mar 6, 2022, at 09:35, Lluís Alemany-Puig via Ipe-discuss wrote:
>> Now, I've been told that I have to send a png file of dimensions
>> 2500x1406 (I believe in pixels -- they didn't specify units) to one of
>> the conference organizers, so I thought I would make a stylesheet with
>> layout size 2500x1408, like this:
>>> <?xml version="1.0"?>
>>> <!DOCTYPE ipestyle SYSTEM "ipe.dtd">
>>> <ipestyle name="poster_format">
>>> <!-- layout size for the poster -->
>>> <layout paper="2500 1408" origin="0 0" frame="2500 1408"/>
>>> <! -- other stuff, like colors and such -->
>>> </ipestyle>
>> and then export the ipe file to a png. That, however, did not work
>> quite as expected: the exported png file did not have the same
>> dimensions as the layout. In fact, the png had different dimensions
>> depending on the zoom level on the canvas: e.g. the smaller I could see
>> the contents on IPE's GUI, the smaller (in dimensions) the png file.
> The physical dimensions of the Ipe document page are for PDF output - they really have nothing to do with the pixel resolution when you export to PNG.    As you noticed the pixel resolution depends on the zoom level.  The easiest way to achieve what you want would be to call 'iperender' from the command line:
> iperender -png -resolution 72 -nocrop poster.ipe poster.png
> The '-resolution 72' makes sure that you get a resolution matching what you set in your style sheet.   The '-nocrop' option makes sure that the whole page is exported, so that you get exactly 2500 x 1408 pixels.
> If you don't like the command line, you can export from inside Ipe *after* setting the zoom to exactly 72.  (Zoom -> Normal size does that, the lower right corner then displays "72ppi").   However, this will crop the image, so you need to add some object to fill the entire page, e.g. a white rectangle in the background.  (You can also put that rectangle in an extra layer named BBOX and make that invisible - it will still be counted for the cropping.)
> Some remarks:
> 1. Often it is easier to choose a different physical size, so that the font sizes and symbolic sizes work well without redefining everything.   In your case, you could have set the paper size to be 1250 x 704, and then export at resolution 144.
> 2. You don't need to make a big new style sheet.  You could for instance use that standard presentation style sheet, and then just add another short style sheet that only changes the paper size:
> <?xml version="1.0"?>
> <!DOCTYPE ipestyle SYSTEM "ipe.dtd">
> <ipestyle name="poster_format">
> <layout paper="2500 1408" origin="0 0" frame="2500 1408" crop="no" />
> </ipestyle>
> Cheers,
>    Otfried
> _______________________________________________
> Ipe-discuss mailing list
> Ipe-discuss at lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/ipe-discuss

More information about the Ipe-discuss mailing list