1
$\begingroup$

I would like to combine several images with ImageCompose using Images and rasterized graphics. When I create a Disk with RadialGradientFilling and want to have no background on the rasterized graphic it gives an for me at least unexpected result.

Rasterize[
 Graphics[{{RadialGradientFilling[{0, 1} -> {RGBColor[
       0.7803921568627451, 0.9084967320261438, 1.], RGBColor[
       0.011764705882352941`, 0.5882352941176471, 1.]}], 
    Disk[{3, 5}, 1]}}, PlotRange -> {{0, 10}, {0, 10}}, 
  ImageSize -> 300], ImageResolution -> 72]

gives (without Background->None)

enter image description here

and using Background -> None

Rasterize[
 Graphics[{{RadialGradientFilling[{0, 1} -> {RGBColor[
       0.7803921568627451, 0.9084967320261438, 1.], RGBColor[
       0.011764705882352941`, 0.5882352941176471, 1.]}], 
    Disk[{3, 5}, 1]}}, PlotRange -> {{0, 10}, {0, 10}}, 
  ImageSize -> 300], Background -> None, ImageResolution -> 72]

gives

enter image description here

$\endgroup$
2
  • $\begingroup$ Surprised to find no reaction. Perhaps I missed something obvious but I would still like to know! $\endgroup$
    – Lou
    Jan 30, 2021 at 8:04
  • $\begingroup$ This seems to be a Windows related bug. Could somebody with an apple system and linux try to replicate this? $\endgroup$
    – Lou
    Feb 11, 2021 at 20:26

1 Answer 1

1
$\begingroup$

This seems to be a workaround (with the help of Wolfram Support)

    Rasterize[
 Style[Graphics[{{RadialGradientFilling[{0, 
        1} -> {RGBColor[0.7803921568627451, 0.9084967320261438, 1.], 
           RGBColor[0.011764705882352941`, 0.5882352941176471, 1.]}], 
          Disk[{3, 5}, 1]}}, PlotRange -> {{0, 10}, {0, 10}}, 
   ImageSize -> 300], 
  RenderingOptions -> {"3DRenderingEngine" -> "Mesa"}], 
  Background -> None, ImageResolution -> 72]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.