![]() These are related by: (# pixels) * DPI = (# inches)īokeh fixes the (# pixels). And more importantly, you can set the DPI value in the image file to anything you want. But anything and anyone is free to ignore the DPI value. In general, the only effect the DPI value in the file has is to tell other software (that cares to look), how much physical space those pixels should take up. If you ask Bokeh for 300x300 output, you will get an image with 300x300 pixels. It’s definitely pixels, and the number of pixels simply is what it is. If you are just asking for a way to override the reported DPI in the image, then that’s probably a simple thing to do and I don’t see why it couldn’t be done as long as the documentation was extremely clear that setting the value is you stipulating a DPI. I don’t think there is any value in that, until or unless there is also a way to specify things like line widths in DPI-aware units, but that would be a non-trivial task. It sounds like what you are are asking for is an API that takes a DPI and a target image size in physical units, and automatically generates an image of an appropriate pixel size based on those given physical dimensions? There is no API in Bokeh that will do that. The DPI field in the image is mostly irrelevant, since nothing at all can stop you from rendering a 300x300 pixel, “300 DPI” image in ten inches of screen space, making that DPI value completely false. In this example, we are creating a figure with a circle glyph and then simply rendering the image from the given URL using the glyph ImageURL.DPI is a function of the pixel resolution (size) and the actual physical dimensions that you render that image of that size into.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |