nion-software / nionswift

Nion Swift is open source scientific image processing software integrating hardware control, data acquisition, visualization, processing, and analysis using Python. Nion Swift is easily extended using Python. It runs on Windows, Linux, and macOS.
http://nion.com/swift
GNU General Public License v3.0
43 stars 33 forks source link

Export to SVG should give options for scaling on non-compliant viewers #972

Open cmeyer opened 11 months ago

cmeyer commented 11 months ago

The default scaling for images is to smoothly scale. There is a CSS4 option style='image-rendering:pixelated' that works when viewing on Chrome, but not on PowerPoint (as of this writing). The alternative implementation is to allow the user to specify a DPI for the SVG (which would be helpful for text anyway) and then scale images on the export side to match the DPI.

When exporting, user can choose the physical size of the export (inches or cm). Fixed ratio data items (images) will fill the physical size in the largest dimension. Variable ratio data items (line plots) will fill both dimensions. All lines are drawn such that if the DPI is 96dpi, the lines will draw as 1 pixel; likewise, text will draw around 14pt at 96dpi. If the user chooses a different DPI, lines and text will be scaled to appear the same as if drawn at 96dpi; images will be drawn at the higher resolution, i.e. more pixels in the same physical size. Zoom, image position, and general display within the display panel will have no effect on the SVG export. Users can use crop tools if only a portion of an image is desired.

tylerharvey commented 9 months ago

I'm not sure how hard it is to access this, but one easy fix for default scaling would be to treat it like a screenshot and use the current window size at time of export.