ImageMagick:气缸将原始的原始

发布于 2025-01-25 15:59:34 字数 913 浏览 1 评论 0原文

我正在尝试通过ImageMagick制作气缸包装。它在创建气缸方面工作正常,但它可以将原始图像保留在背面。

magick \
-verbose \
\( \
      -size 2585x1181 \
      xc:blue \
      \( \
         ./images/test.png \
         -geometry +820+0 \
      \) \
      -composite \
      -geometry 730x390 \
      -roll -230+0 \
      -crop 270x408+0+0 \
      +append \
\) \
-gravity south -background Transparent -splice 0x40 \
\( +clone -sparse-color barycentric '0,0 black 273,0 white' \) \
\( -clone 1 -function arcsin 0.5 \) \
\( -clone 1 -level 0%,100% \
            -function polynomial -4,4,0 -gamma 2 \
            +level 50%,0%  \) \
-delete 1 \
-virtual-pixel Transparent \
-define compose:args=0x40 \
-compose Displace \
-composite \
./output/out.png

想法?

谢谢

I'm trying to make a cylinder wrap via ImageMagick. It's working fine on creating the cylinder, but it's keeping the original image on back.

magick \
-verbose \
\( \
      -size 2585x1181 \
      xc:blue \
      \( \
         ./images/test.png \
         -geometry +820+0 \
      \) \
      -composite \
      -geometry 730x390 \
      -roll -230+0 \
      -crop 270x408+0+0 \
      +append \
\) \
-gravity south -background Transparent -splice 0x40 \
\( +clone -sparse-color barycentric '0,0 black 273,0 white' \) \
\( -clone 1 -function arcsin 0.5 \) \
\( -clone 1 -level 0%,100% \
            -function polynomial -4,4,0 -gamma 2 \
            +level 50%,0%  \) \
-delete 1 \
-virtual-pixel Transparent \
-define compose:args=0x40 \
-compose Displace \
-composite \
./output/out.png

enter image description here

Thoughts?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

-残月青衣踏尘吟 2025-02-01 15:59:34

问题在于,在ImageMagick 7中,无论是错误还是设计功能,都需要将失真作为一个图像组成,其中前两个通道中的X和Y扭曲,而不是单独的图像。

在ImageMagick 6中,此作品

convert \
-verbose \
\( \
      -size 2585x1181 \
      xc:blue \
      \( \
         test.png \
         -geometry +820+0 \
      \) \
      -composite \
      -resize 730x390 \
      -roll -230+0 \
      -crop 270x408+0+0 +repage \
\) \
-gravity south -background none -splice 0x40 \
\( -clone 0 -set colorspace Gray -alpha off -sparse-color barycentric '0,0 black 270,0 white' \) \
\( -clone 1 -function arcsin 0.5 \) \
\( -clone 1 \
            -function polynomial -4,4,0 -gamma 2 \
            +level 50%,0% \) \
-delete 1 \
-background none -virtual-pixel none \
-define compose:args=20x40 \
-compose Displace \
-composite \
test_out1.png

”在此处输入图像描述”

但是在ImageMagick 7中,您必须执行

magick \
\( \
      -size 2585x1181 \
      xc:blue \
      \( \
         test.png \
         -geometry +820+0 \
      \) \
      -composite \
      -geometry 730x390 \
      -roll -230+0 \
      -crop 270x408+0+0 \
\) \
-gravity south -background Transparent -splice 0x40 \
\( +clone \
   -set colorspace Gray \
   -alpha off \
   -sparse-color barycentric '0,0 black 273,0 white' \
  \( -clone 0 -function arcsin 0.5 \) \
  \( -clone 0 \
     -function polynomial -4,4,0 -gamma 2 \
     +level 50%,0%  \) \
  \( +clone \) \
  -delete 0 \
  -combine \
  -alpha off \
\) \
-virtual-pixel Transparent \
-define compose:args=20x40 \
-compose Displace \
-composite \
+channel \
test_out3.png

< img src =“ https://i.sstatic.net/iwj6f.png” alt =“在此处输入图像说明”>

The issue is that in Imagemagick 7, whether a bug or a design feature, the distortion needs to be composed as one image with the X and Y distortions in the first two channels rather than as separate images.

In Imagemagick 6, this works

convert \
-verbose \
\( \
      -size 2585x1181 \
      xc:blue \
      \( \
         test.png \
         -geometry +820+0 \
      \) \
      -composite \
      -resize 730x390 \
      -roll -230+0 \
      -crop 270x408+0+0 +repage \
\) \
-gravity south -background none -splice 0x40 \
\( -clone 0 -set colorspace Gray -alpha off -sparse-color barycentric '0,0 black 270,0 white' \) \
\( -clone 1 -function arcsin 0.5 \) \
\( -clone 1 \
            -function polynomial -4,4,0 -gamma 2 \
            +level 50%,0% \) \
-delete 1 \
-background none -virtual-pixel none \
-define compose:args=20x40 \
-compose Displace \
-composite \
test_out1.png

enter image description here

But in Imagemagick 7, you have to do

magick \
\( \
      -size 2585x1181 \
      xc:blue \
      \( \
         test.png \
         -geometry +820+0 \
      \) \
      -composite \
      -geometry 730x390 \
      -roll -230+0 \
      -crop 270x408+0+0 \
\) \
-gravity south -background Transparent -splice 0x40 \
\( +clone \
   -set colorspace Gray \
   -alpha off \
   -sparse-color barycentric '0,0 black 273,0 white' \
  \( -clone 0 -function arcsin 0.5 \) \
  \( -clone 0 \
     -function polynomial -4,4,0 -gamma 2 \
     +level 50%,0%  \) \
  \( +clone \) \
  -delete 0 \
  -combine \
  -alpha off \
\) \
-virtual-pixel Transparent \
-define compose:args=20x40 \
-compose Displace \
-composite \
+channel \
test_out3.png

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文