Hello, I'm using the image exporter to create PNG files. Everything looks good but the files must have a resolution of 1,200 pixels in the horizontal direction. The snippet to create the image file reads: exporter = QgsLayoutExporter(layout) png_name = '/home/ubuntu/output/testing.png' exporter.exportToImage(png_name, QgsLayoutExporter.ImageExportSettings()) The created file has a resolution of 3507 by 2480 pixels (not sure where these figures come from but QGIS seems to always use them). When I modify the snippet with exporter = QgsLayoutExporter(layout) canvas_settings = exporter.ImageExportSettings() canvas_settings.dpi = 100 png_name = '/home/ubuntu/output/testing.png' exporter.exportToImage(png_name, settingsÊnvas_settings) The new file has a resolution of 1169x826 pixels (which is not very far from what I need). However, and when I try a tighter control with: exporter = QgsLayoutExporter(layout) canvas_settings = exporter.ImageExportSettings() canvas_settings.imageSize = QSize(1200,750) png_name = '/home/ubuntu/output/testing.png' exporter.exportToImage(png_name, settingsÊnvas_settings) it just seems to ignore QSize and reverts back to a 3507x2480 resolution. I'm not sure how achieve a finer control over the output. Thanks. P.S. QGIS is v3.34
_______________________________________________ QGIS-User mailing list QGIS-User@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user