I want to export an image exactly as it is shown in the notebook, but when I specify a high image resolution, the image saved to disk does not match what is shown in the notebook (the image saved appears to be an uncropped version of the image). I am running the following code to produce the graphic:
polygonSwirl[
polygon_: Disk[], thickness_: .8, depth_: 20, color_: Blue,
edgeColor_: Black, scalingRate_: .2, xtranslationRate_: .2,
ytranslationRate_: .2, background_: White, rotationRate_: 1,
rotPoint_: {1, 1}, rotModifier_: 5
] := Graphics[{EdgeForm[
Directive[{AbsoluteThickness[thickness], edgeColor}]], color,
GeometricTransformation[
polygon,
Table[
ScalingTransform[{α/(depth - α)^scalingRate,
α/(depth - α)^scalingRate}].TranslationTransform[{-α^
xtranslationRate, α^ytranslationRate}].RotationTransform[π/(depth - \
α)^rotationRate, rotPoint + rotModifier/α],
{α, (depth - 1), 1, -1}]
],
}, Background -> background, PlotRangeClipping -> True
];
polygonSwirl[
polygon = Disk[],
thickness = .4,
depth = 100,
color = LightPink,
edgeColor = Lighter@Purple,
scalingRate = -.1,
xtranslationRate = -1,
ytranslationRate = -1,
background = LightPink,
rotationRate = -.999,
rotPoint = {0, 0},
rotModifier = 5
]
The output shown (I took a screenshot) is
But the image saved to disk when I run this code is different:
Export["~/Desktop/diskSwirl.png", %, ImageResolution -> 500]
How do I ensure that the image exported matches what is shown in the notebook exactly? Screenshots do not have high enough resolution for my purposes.
Import
of theExport
:img = Import[Export["~/Desktop/diskSwirl.png", polygonSwirl[polygon = Disk[], thickness = .4, depth = 100, color = LightPink, edgeColor = Lighter@Purple, scalingRate = -.1, xtranslationRate = -1, ytranslationRate = -1, background = LightPink, rotationRate = -.999, rotPoint = {0, 0}, rotModifier = 5], ImageResolution -> 500]]
$\endgroup$