英文:
Is there a way to generate image stretch distortion using algorithms or specific patterns?
问题
如何生成像图像中的那种拉伸扭曲效果?
我尝试检查像素。它们具有一定的线性,但我想知道是否有某种模式或算法可以实现这种效果。我还检查了ImageMagick中可用的扭曲效果,但没有找到类似这种模式的东西。
英文:
How to generate stretched distortion in image like the one in the image?
I tried to check the pixels. They have some linearity, but I wondered if there is some pattern or algorithm to do that. Also i checked ImageMagick available distortions but i did not find anything like this pattern.
答案1
得分: 2
你可以在Imagemagick中执行以下操作。
选择y=140和270处的两行。裁剪它们。连接它们。将其调整大小为高度差130。从y=140开始插入到图像中。鉴于图像宽度=400,我们有
输入:
Imagemagick 6的Unix语法:
convert barn.jpg \
\( -clone 0 -crop "400x1+0+140" +repage \) \
\( -clone 0 -crop "400x1+0+270" +repage \) \
\( -clone 1,2 -append -filter triangle -resize 400x131! \) \
-delete 1,2 \
-geometry +0+140 -compose over -composite \
barn_interp.png
结果:
英文:
You can do the following in Imagemagick.
Pick two rows at y=140 and 270. Crop them. Append them. Resize to the difference of 130 height. Insert that into the image starting at y=140. Given that the image width = 400, we have
Input:
Unix Syntax for Imagemagick 6:
convert barn.jpg \
\( -clone 0 -crop "400x1+0+140" +repage \) \
\( -clone 0 -crop "400x1+0+270" +repage \) \
\( -clone 1,2 -append -filter triangle -resize 400x131! \) \
-delete 1,2 \
-geometry +0+140 -compose over -composite \
barn_interp.png
Result:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论