用imageMagick的composite合并图片

composite命令可以非常方便的合并两张图片

因此用来进行图像加水印、批量增加边框等常用的变换

 

最简单的用法为:

 

composite -gravity north src.jpg coverback.jpg des.jpg

 

其中src.jpg为前景图片

coverback.jpg为背景图片。

des.jpg为叠加后的结果

 

-gravity north 指叠加位置为垂直据顶部、水平居中(正北方向)

如果要求在正中间,参数为center

如果要求在右下角,参数为southeast

 

composite还提供更灵活的定位,可以使用 -geometry 配置

 

具体的composite参数表见下表

 

 

-affine matrix

affine transform matrix
-alphaon, activate, off, deactivate, set, opaque, copy", transparent, extract, background, or shape the alpha channel
-authenticate valuedecrypt image with this password
-blend geometryblend images
-blue-primary pointchromaticity blue primary point
-border geometrysurround image with a border of color
-bordercolor colorborder color
-channel typeapply option to select image channels
-colors valuepreferred number of colors in the image
-colorspace typeset image colorspace
-comment stringannotate image with comment
-compose operatorset image composite operator
-compress typeimage compression type
-debug eventsdisplay copious debugging information
-decipher filenameconvert cipher pixels to plain
-define format:optiondefine one or more image format options
-density geometryhorizontal and vertical density of the image
-depth valueimage depth
-displace geometryshift image pixels defined by a displacement map
-dissolve valuedissolve the two images a given percent
-dither methodapply error diffusion to image
-encipher filenameconvert plain pixels to cipher pixels
-encoding typetext encoding type
-endian typeendianness (MSB or LSB) of the image
-extract geometryextract area from image
-filter typeuse this filter when resizing an image
-font namerender text with this font
-geometry geometrypreferred size or location of the image
-gravity typehorizontal and vertical text placement
-green-primary pointchromaticity green primary point
-helpprint program options
-identifyidentify the format and characteristics of the image
-interlace typetype of image interlacing scheme
-interpolate methodpixel color interpolation method
-label stringassign a label to an image
-level valueadjust the level of image contrast
-limit type valuepixel cache resource limit
-log formatformat of debugging information
-monitormonitor progress
-monochrometransform image to black and white
-negatereplace each pixel with its complementary color
-page geometrysize and location of an image canvas (setting)
-pointsize valuefont point size
-profile filenameadd, delete, or apply an image profile
-quality valueJPEG/MIFF/PNG compression level
-quantize colorspacereduce image colors in this colorspace
-quietsuppress all warning messages
-red-primary pointchromaticity red primary point
-regard-warningspay attention to warning messages.
-respect-parenthesessettings remain in effect until parenthesis boundary.
-rotate degreesapply Paeth rotation to the image
-sampling-factorgeometryhorizontal and vertical sampling factor
-scene valueimage scene number
-seed valueseed a new sequence of pseudo-random numbers
-set attribute valueset an image attribute
-sharpen geometrysharpen the image
-shave geometryshave pixels from the image edges
-size geometrywidth and height of image
-stegano offsethide watermark within an image
-stereo geometrycombine two image to create a stereo anaglyph
-stripstrip image of all profiles and comments
-swap indexesswap two images in the image sequence
-synchronizesynchronize image to storage device
-taintmark the image as modified
-thumbnail geometrycreate a thumbnail of the image
-tilerepeat composite operation across and down image
-transformaffine transform image
-transparent-colorcolortransparent color
-treedepth valuecolor tree depth
-type typeimage type
-units typethe units of image resolution
-unsharp geometrysharpen the image
-verboseprint detailed information about the image
-versionprint version information
-virtual-pixel methodaccess method for pixels outside the boundaries of the image
-watermarkgeometrypercent brightness and saturation of a watermark
-white-point pointchromaticity white point
-white-thresholdvalueforce all pixels above the threshold into white
-write filenamewrite images to this file
本文转自博客园知识天地的博客,原文链接:用imageMagick的composite合并图片,如需转载请自行联系原博主。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/278923.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

白帽子讲web安全——认证与会话管理

在看白帽子讲web安全,刚好看到认证与会话管理:也就是我们在平常渗透测试中遇到最多的登录页面,也即是用户名和密码认证方式,这是最常见的认证方式。 了解两个概念:认证和授权 1):认证的目的是为…

iphone充电图_哪些iPhone具有无线充电功能?

iphone充电图Kevin Parrish凯文帕里什Wireless charging means you can re-energize your phone’s battery without a physical tether. It also prevents possible damage to your phone’s charging port. Unfortunately, not all phones support wireless charging, but we…

关联分析算法c语言实现,机器学习关联分析

AI开发平台ModelArtsModelArts是面向开发者的一站式AI开发平台,为机器学习与深度学习提供海量数据预处理及半自动化标注、大规模分布式Training、自动化模型生成,及端-边-云模型按需部署能力,帮助用户快速创建和部署模型,管理全周…

windows平台下基于QT和OpenCV搭建图像处理平台

在之前的博客中,已经分别比较详细地阐述了“windows平台下基于VS和OpenCV”以及“Linux平台下基于QT和OpenCV"搭建图像处理框架,并且生成了相应的免费视频。这篇博客的主要内容,就是基于最新版本的相应工具,在windows平台下&…

android死锁解决方案,【线程死锁】Android多线程死锁产生的原因以及如何避免

一、死锁定义1、生活中的列子两人吃饭,但只有一双筷子,2人轮流吃(同时拥有2只筷子才能吃),某个时候一人拿了左筷子,一人拿了右筷子,两人同时占用一个资源,等待另一个资源,这时候甲等乙吃完并释放…

前端开发 常用用的静态服务器

1 运用anywhere 安装 :npm install anywhere -g想要以某个路径作为静态文件服务器的根目录分享,只需要在该目录下执行:anywhere 就会默认8000打开网页, 若文件不是index.html 需要输入文件名 A: anywhere -p 8000 ## 指定静态服务…

前端面试题整理

1.HTML5的新特性。 主要讲讲新增哪些API:地理定位,拖放,web存储应用缓存,webworkers, sse 。 http://www.w3school.com.cn/html5/html_5_intro.asp 2.CSS3的新特性。 https://segmentfault.com/a/1190000010780991 3、使用严格模式…

android mvvm 官方例子,详解Android的MVVM框架 - 数据绑定

本教程是跟着 Data Binding Guide学习过程中得出的一些实践经验,同时修改了官方教程的一些错误,每一个知识点都有对应的源码,争取做到实践与理论相结合。Data Binding 解决了 Android UI 编程中的一个痛点,官方原生支…

VS2015 代码左缩进

TabShift转载于:https://www.cnblogs.com/527289276qq/p/8027882.html

mac设置文件权限_如何在Mac上设置文件权限

mac设置文件权限Like all major operating systems, macOS allows you to restrict access to files using a complex set of file permissions. You can set these yourself using the Finder app, or by using the chmod command in your Mac’s terminal. Here’s how. 与所…

Discrete Log Algorithms :Baby-step giant-step

离散对数的求解 1.暴力 2.Baby-step giant-step 3.Pollard’s ρ algorithm …… 下面搬运一下Baby-step giant-step 的做法 这是在 https://ctf-wiki.github.io/ctf-wiki/crypto/asymmetric/discrete-log/discrete-log/ 上看到的,比较容易理解。 而且,…

Android添加item动画,RecyclerView基础篇-Item添加动画

Android_Banner.jpg简介本节中我们介绍下给RecyclerView中的Item添加动画。添加的动画,分为,在打开列表时有Item的展示动画,当滑动的时候没有动画和打开列表滑动时有动画两种实现过程实现一个列表效果如下Screenshot_2020-09-01-17-03-35-349…

Oracle数据库查询用 where in 查询的项超过1000条的解决方案

众所周知,如果我们的用SQL查询语句时,如果用where in带的参数超过1000条的话,oracle是会报错的。 因为项目中遇到这样的问题,所以找到了接下来我要说的这个办法。 因为用的地方很多,所以我把这个封装成了一个方法。 //…

geek_Ask How-To Geek:营救受感染的PC,安装无膨胀iTunes和驯服疯狂的触控板

geekYou’ve got questions and we’ve got answers. Today we highlight how to save your computer if it’s so overrun by viruses and malware you can’t work from within Windows, install iTunes without all the bloat, and tame a hyper-sensitive trackpad. 您有问…

第1课:接口测试和jmeter总结

接口测试 1. 接口的分类:webService和http api接口1) webService接口:是按照soap协议通过http传输,请求报文和返回报文都是xml格式,一般要借助工具来测试接口;2) http api接口:是按照…

android 工作日,如何在Android上重复警报工作日

小编典典请尝试此代码。已在我的应用中成功运行if (chk_monday.isChecked()) {forday(2);} else if (chk_tuesday.isChecked()) {forday(3);} else if (chk_wednesday.isChecked()) {forday(4);} else if (chk_thursday.isChecked()) {forday(5);} else if (chk_friday.isCheck…

hdu4419

对于这类面积覆盖的题,大致就两点要注意的 1.同一把矩形放在笛卡尔坐标系上做 2.pushup函数要注意下细节:及在统计子区间和之前要先判断是否有子区间 用sum数组来保存区间被覆盖的情况,如果遇到多次覆盖问题,那就开多个sum数组分别保存被覆盖…

最简单 - 单例模式

public class Person {// Person 引用private static Person p null;static {if (p null) {p new Person();}}/***单例模式获取Person对象. * return*/public static Person getInstance(){return p;} ​} 复制代码转载自: 简书 - 低至一折起 文章:w…

极客时间和极客学院_极客历史记录的本周:Twitter的诞生,OS X十周年以及太空停留时间最长的时代即将结束...

极客时间和极客学院Every week we bring you interesting trivia and milestones from the archives of Geekdom. Today we’re taking a peek at the birth of Twitter, ten years of Mac OS X, and the longest space stay in history. 每周,我们都会为您带来有趣…

Android风格ppt,Material Design风格的快手PPT

突发奇想,感觉MD风格既然适合 Android 软件的界面,那么在一般PPT 演示中,效果当也是不错。于是在网上去寻了几处制作贴,也简单看了 MD 设计指南的几处要点。先试试一番再说。关于 MD 设计指南和几处制作贴,我会把链接贴…