Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First of all: do not use <code>ImageResolution</code> when exporting! This buggy options is useless most of the time and does not do what one can expect. It works as an analog of <code>ImageSize</code>.</p> <p>Instead, use <code>Magnify</code> command and <code>Magnification</code> option of <code>Style</code>. They do what we want to get from <code>ImageResolution</code>!</p> <p>Now about the reason for the behavior showed in the first part of the question. Yes, it happens. And yes, it is machine-dependent. Is it a bug? Yes, at least a great imperfection. It it completely unexpected? As for me - not.</p> <p>It seems that the source of the problem is that rendering of graphics is in really made by the FrontEnd and the latter uses default settings for <code>Cell</code> when converting graphics to raster. </p> <pre><code>In[1]:= Options[Cell, PageWidth] Out[1]= {PageWidth -&gt; WindowWidth} </code></pre> <p>Lets try to see how output of </p> <pre><code>Table[Rasterize[Style[x^2 + y^2, 40], Background -&gt; None, ImageResolution -&gt; r], {r, {300, 400, 500, 600}}] </code></pre> <p>looks at different <strong>run-time</strong> sizes of the notebook window:</p> <p><a href="https://i.stack.imgur.com/tZqJS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tZqJS.png" alt="enter image description here"></a></p> <p>One can see the obvious dependence of the output on the notebook window size.</p> <p>A workaround is to pass <code>PageWidth</code> directly to <code>Cell</code>:</p> <pre><code>Rasterize[ Cell[BoxData@ToBoxes@Style[x^2 + y^2, 40], PageWidth -&gt; Infinity], ImageResolution -&gt; 600] </code></pre> <p><img src="https://i.stack.imgur.com/Ejed4.png" alt="enter image description here"></p> <hr> <p>P.S. In addition. The only case I know when <code>ImageResolution</code> works as expected is PDF export with <code>"AllowRasterization"-&gt;True</code>:</p> <pre><code>First@ImportString[ ExportString[Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}], "PDF", "AllowRasterization" -&gt; True, ImageResolution -&gt; 200], "PDF"] </code></pre> <p>But it does not allow to specify transparent background.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload