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
-alpha on, activate, off, deactivate, set, opaque, copy", transparent, extract, background, or shape the alpha channel
-authenticate value decrypt image with this password
-blend geometry blend images
-blue-primary point chromaticity blue primary point
-border geometry surround image with a border of color
-bordercolor color border color
-channel type apply option to select image channels
-colors value preferred number of colors in the image
-colorspace type set image colorspace
-comment string annotate image with comment
-compose operator set image composite operator
-compress type image compression type
-debug events display copious debugging information
-decipher filename convert cipher pixels to plain
-define format:option define one or more image format options
-density geometry horizontal and vertical density of the image
-depth value image depth
-displace geometry shift image pixels defined by a displacement map
-dissolve value dissolve the two images a given percent
-dither method apply error diffusion to image
-encipher filename convert plain pixels to cipher pixels
-encoding type text encoding type
-endian type endianness (MSB or LSB) of the image
-extract geometry extract area from image
-filter type use this filter when resizing an image
-font name render text with this font
-geometry geometry preferred size or location of the image
-gravity type horizontal and vertical text placement
-green-primary point chromaticity green primary point
-help print program options
-identify identify the format and characteristics of the image
-interlace type type of image interlacing scheme
-interpolate method pixel color interpolation method
-label string assign a label to an image
-level value adjust the level of image contrast
-limit type value pixel cache resource limit
-log format format of debugging information
-monitor monitor progress
-monochrome transform image to black and white
-negate replace each pixel with its complementary color
-page geometry size and location of an image canvas (setting)
-pointsize value font point size
-profile filename add, delete, or apply an image profile
-quality value JPEG/MIFF/PNG compression level
-quantize colorspace reduce image colors in this colorspace
-quiet suppress all warning messages
-red-primary point chromaticity red primary point
-regard-warnings pay attention to warning messages.
-respect-parentheses settings remain in effect until parenthesis boundary.
-rotate degrees apply Paeth rotation to the image
-sampling-factorgeometry horizontal and vertical sampling factor
-scene value image scene number
-seed value seed a new sequence of pseudo-random numbers
-set attribute value set an image attribute
-sharpen geometry sharpen the image
-shave geometry shave pixels from the image edges
-size geometry width and height of image
-stegano offset hide watermark within an image
-stereo geometry combine two image to create a stereo anaglyph
-strip strip image of all profiles and comments
-swap indexes swap two images in the image sequence
-synchronize synchronize image to storage device
-taint mark the image as modified
-thumbnail geometry create a thumbnail of the image
-tile repeat composite operation across and down image
-transform affine transform image
-transparent-colorcolor transparent color
-treedepth value color tree depth
-type type image type
-units type the units of image resolution
-unsharp geometry sharpen the image
-verbose print detailed information about the image
-version print version information
-virtual-pixel method access method for pixels outside the boundaries of the image
-watermarkgeometry percent brightness and saturation of a watermark
-white-point point chromaticity white point
-white-thresholdvalue force all pixels above the threshold into white
-write filename write images to this file

本文转自博客园知识天地的博客,原文链接:用imageMagick的composite合并图片,如需转载请自行联系原博主。

用imageMagick的composite合并图片相关推荐

  1. 巧妙的有css合并图片解决tab切换的背景图片

    巧妙的有css合并图片解决tab切换的背景图片 有时候做tab切换的时候 会碰到下面的这种情况 我截个图过来看看 tab切换 打开页面时候 茶庄介绍  及鼠标移上去时候 是上面这样的效果  当鼠标移下 ...

  2. 减少HTTP请求之合并图片详解(大型网站优化技术)

    一.相关知识讲解 看过雅虎的前端优化35条建议,都知道优化前端是有多么重要.页面的加载速度直接影响到用户的体验.80%的终端用户响应时间都花在了前端上,其中大部分时间都在下载页面上的各种组件:图片,样 ...

  3. ImageIO 合并图片工具

    package com.huajie.bim;/*** @Date: 2019/6/15 14:11* @Description: 合并图片工具*/import javax.imageio.Image ...

  4. linux查看图片的拍摄时间,ImageMagick 的一些高级图片查看技巧 | Linux 中国

    用这些 ImageMagick 命令行图像编辑应用的技巧更好的管理你的数码照片集. 在我先前的[1] 文章中,我展示了如何使用 ImageMagick 的菜单栏进行图片的编辑和变换风格.在这篇续文里, ...

  5. html设置图片切割,HTML+CSS实现合并图片的切割显示以及背景渲染

    今天用了大约3小时才搞定了这么一小点工作.. 合并图片的切割显示是我早就想研究一下的,因为这个东西应用非常广泛,今天总算在HTML的框架里有了些了解. 核心代码为: div标签是个很好的东西,用来逻辑 ...

  6. m3u8下载合并图片文件(但实际上还是ts文件)

    m3u8合并图片类型 如图可见,当要下载某个视频文件时发现是m3u8类型的.已知其会将视频划分为ts类型文件,具体原因不在此赘述. 但是发现我们获取到的是png图片类型文件,怎么回事呢? 使用hexd ...

  7. linux查看image类型,ImageMagick 的一些高级图片查看技巧

    用这些 ImageMagick 命令行图像编辑应用的技巧更好的管理你的数码照片集. 在我先前的ImageMagick 入门:使用命令行来编辑图片 文章中,我展示了如何使用 ImageMagick 的菜 ...

  8. Android拼接合并图片生成长图

    Android拼接合并图片生成长图 代码实现合并两张图片,以第一张图片的宽度为标准,如果被合并的第二张图片宽度和第一张不同,那么就以第一张图片的宽度为准线,对第二张图片进行缩放. 假设根目录的Pict ...

  9. Java 利用Graphics2D 合并图片(png格式可设置透明)

    利用Graphics2D 合并图片 效果如下: 图一图二合并成图三 tip:  需要上图的效果 frontgroud需要为png格式 附上代码: import javax.imageio.ImageI ...

最新文章

  1. mysql提示符详解_MySQL字符集使用详解
  2. 教你使用stm32接收串口的一帧数据!
  3. 神策数据 App 可视化全埋点 2.0 重磅升级!抢先体验
  4. ROS-Solidworks转URDF
  5. windows下实现微秒级的延时
  6. Spring MVC-表单(Form)标签-下拉框(Dropdown)示例(转载实践)
  7. python tkinter控件_python tkinter 控件与布局 项目实战
  8. JAVA进阶教学之(8种包装类)
  9. 一个java中HashMap和HashSet的应用实例
  10. wtf是转换ttf_WTF入门,它是终端的仪表板
  11. 是谁关闭了Linux抢占,而抢占又关闭了谁?
  12. Nginx+Tomcat关于Session的管理
  13. 在线生成ico图标的网站
  14. 【ansys workbench】3.圆角L型支架的应力结果
  15. 递归实现求最大公约数
  16. python求股票收益率_python – 有没有办法自动获取许多股票的一般信息,如市盈率,收益率等等?...
  17. Bernoulli Number
  18. 浅谈互联网DD攻击和CC攻击
  19. 法国西南部发生火车追尾事故 已造成至少40人伤
  20. Unity3D 2021.1.2F1 发布了。赋国际版本下载地址。

热门文章

  1. oracle 察看用户是否被锁,解锁以及改密码
  2. 四维偏序 CDQ套CDQ
  3. iscroll 4.0 滚动(水平和垂直)
  4. 简化工作——我的bat文件
  5. 在Red Hat 4 AS U7上安装oracle10gR2
  6. java返回两个string_java – 为什么String.intern()方法返回两个不同的结果?
  7. python udp 大文件_Python:通过UDP发送大对象
  8. ubuntu php 树莓派,树莓派3 安装ROS环境(ubuntu mate 16.04+kinetic)
  9. git分支feature和hotfix分支
  10. 前端工具:推荐几款UI设计师好用的设计软件