[英]How to edit the exposure of an HDRI image using GraphicsMagick and Node.js?
[英]how to control the distorted and stretched image in graphicsmagick node.js
我希望通过调整大小来保持其宽高比不变,以显示图像,但是图像看起来很拉伸。 我有三幅图像,每幅图像都是50 x50。我想通过保持其纵横比来调整左图像的大小。 其他两个图像将与第一个图像平行显示。 我认为mosaic()构建了四个块。 但是我要三个块,在最合适的块中,第一个图像将出现,并且将一直调整大小直到结束,接下来的两个块中,其他两个图像将上下显示并与第一个图像平行。 下面是代码
gm()
.in('-page', '+0+0')
.in('-resize', '50x100!')
.in('http://localhost:8080/image1')
.in('-page', '+50+0')
.in('http://localhost:8080/image2')
.in('-page', '+50+50')
.in('http://localhost:8080/image3')
.mosaic()
.write('C:/images/output.jpg', function (err) {
if (err) console.log(err);
});
我想要一个像下面这样的图像,但要保持其长宽比,黑色图像看起来要拉伸,我不要拉伸,黑色图像应该覆盖整个左侧区域,直到结束
如果我删除! 然后图像看起来像,我想要上面的图像,但不拉伸
我不使用node
但我认为您将能够对此进行调整:
使我们的三个图像:
convert -size 50x50 -background black -fill white -gravity center -pointsize 36 label:"1" image1.jpg
convert -size 50x50 -background red -fill white -gravity center -pointsize 36 label:"2" image3.jpg
convert -size 50x50 -background red -fill white -gravity center -pointsize 36 label:"3" image3.jpg
现在调整大小并安排:
convert image1.jpg -resize x100 -gravity center -extent 50x100 \( image2.jpg image3.jpg -append \) +append result.png
本质上,我使用-resize x100
将image1
做成100像素高,然后使用-gravity center -extent 50x100
提取中间的中央50像素宽带。 然后,在括号和“最侧”我加载image2
和image3
和放置一个低于其他同-append
。 然后将该对图像附加到+append
到原始图像的右侧, +append
结果写到result.png
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.