网友投稿 | 设为首页 | 加入收藏
1/2页12 跳转到查看:6896
回复该主题 发新话题
键盘左右键可以进行前后翻页操作
帮助

[求助]请教:ImageMagic的用法

[求助]请教:ImageMagic的用法

请教:ImageMagic的用法



1.如何用ImageMagic水平或垂直拼接图片

因为是分片下载的,现在只能用montage拼接图片列阵,但如何水平拼接一组等高的图片 或如何垂直拼接一组等宽的图片呢?

看了几遍说明书,试了很多次还是不明白。
 

2.如何用ImageMagic将图片某一边剪裁掉指定的像素(剪裁掉重复部分或多余部分)?



3.如何用ImageMagic锐化图片?

TOP

 

re:ImageMagick 拼图工具...

ImageMagick 拼图工具



1. 拼图

montage *.jpg  -tile 22x2  -geometry 64x256+0+0 10-.jpg



将目录里的jpg文件按顺序拼成x轴22块,y轴2块的图 ,每个图块的大小为64X512像素,输出文件为10-.jpg



你可以把22*2改成你想要得值,例如你形成的图x轴有50个快,y轴有30个块,你可以写成50x30



把你所有要合成的文件拷在一个目录里,用一个命令就可以合成


 合并图片

用法:

convert +append 1.jpg 2.jpg 3.jpg .... 0.jpg
  把 1.jpg、2.jpg、3.jpg等多张图片沿“水平方向”( +append)拼成 0.jpg(最后一个文件名是拼出的成品)



convert -append 1.jpg 2.jpg 3.jpg .... 0.jpg
  把 1.jpg、2.jpg、3.jpg等多张图片沿“垂直方向”( -append)拼成 0.jpg(最后一个文件名是拼出的成品)



可以分两步,第一步把小图拼成多个水平方向的长条,第二步把长条按垂直方向合并成一个大图。



2.切割图片



切割图片

用法:

convert -crop 128x128 1.jpg 0.jpg
  把大图1.jpg按128x128分割成了多张小图0-1.jpg  0-2.jpg ...
 

convert -crop 128x64+6+7 1.jpg 0.jpg
  从1.jpg 以座标 6,7 为起点切一片 128x64 的块生成 0.jpg


  我也是从人那学的

TOP

 

re:谢谢版主指点还是不知道如何将图片...

谢谢版主指点



还是不知道如何将图片某一边剪裁掉指定的像素,比如:

将一个512*512的0.jpg的右边剪裁掉64像素怎么做(相当于PS的缩小画布)?

TOP

 

re:[COLOR=blue]切图[/COLO...

切图

ImageMagick 方法:
  convert -crop 448x512+0+0 0.jpg 1.jpg
    从0.jpg 以座标 0,0 为起点切一片 448x512 的块生成你要的 1.jpg,相当于右边剪裁掉64像素



IrfanView 命令行方法:
  i_view32.exe 0.jpg /crop=(0,0,448,512) /convert=1.jpg
    从0.jpg 以座标 0,0 为起点切一片 448x512 的块生成你要的 1.jpg,相当于右边剪裁掉64像素



锐化

ImageMagick 方法:
  convert -sharpen 5 0.jpg 1.jpg
    将0.jpg 锐化后生成1.jpg,锐化指数5,此数值越大,锐化度越高,图像细节损失越大



IrfanView 命令行方法:
  i_view32.exe 0.jpg /sharpen=33 /convert=1.jpg
    将0.jpg 锐化后生成1.jpg,锐化指数33,此数值越大,锐化度越高,图像细节损失越大





说明文件

ImageMagick 说明文件 位于安装目录 \www\command-line-tools.html



IrfanView 命令行说明文件 i_options.txt 位于 IrfanView 目录下,此文件内容如下:

-------------------------------------------------------------------------------

File  : 'options.txt' - Command line options for IrfanView

Author: Irfan Skiljan

E-Mail: irfanview@gmx.net

WWW   : http://www.irfanview.com

-------------------------------------------------------------------------------



List of all command line options supported in IrfanViewbr>
--------------------------------------------------------


  /one                  - force "only one instance"
  /fs                   - force Full Screen display
  /bf                   - force "Fit image to desktop" display option
  /title=text           - set window title to "text"
  /pos=(x,y)            - move IrfanView window to x,y
  /convert=filename     - convert input file to "filename" and CLOSE IrfanView
  /slideshow=txtfile    - play slideshow with the files from "txtfile"
  /slideshow=folder     - play slideshow with the files from "folder"
  /thumbs               - force thumbnails
  /killmesoftly         - close all IrfanView instances
  /closeslideshow       - close slideshow and IrfanView after the last image
  /page=X               - open page number X from a multipage input image
  /crop=(x,y,w,h)       - crop input image: x-start, y-start, width, height
  /print                - print (all pages) to default printer and CLOSE IrfanView
  /print="Name"         - print (all pages) to specific printer and CLOSE IrfanView
  /resize=(w,h)         - resize input image to w (width) and h (height)
  /resample=(w,h)       - resample input image to w (width) and h (height)
  /capture=X            - capture the screen or window
  /ini                  - use the Windows folder for INI/LST files (read/save)
  /ini="Folder"         - use the folder "Folder" for INI/LST files (read/save)
  /clippaste            - paste image from the clipboard
  /clipcopy             - copy image to the clipboard
  /silent               - don't show messages for command line read/save errors
  /invert               - invert the input image
  /dpi=(x,y)            - change DPI values
  /scan                 - acquire the image from the TWAIN device (show TWAIN dialog)
  /scanhidden           - acquire the image from the TWAIN device (hide TWAIN dialog)
  /batchscan=(options)  - simulate menu: File->Batch Scan, see below for example
  /bpp=BitsPerPixel     - change color depth of the input image to BitsPerPixel
  /swap_bw              - swap black and white color
  /gray                 - convert input image to grayscale
  /rotate_r             - rotate input image to right
  /rotate_l             - rotate input image to left
  /filepattern="x"      - browse only specific files
  /sharpen=X            - open image and apply the sharpen filter value X
  /contrast=X           - open image and apply the contrast value X
  /hide=X               - hide toolbar, status bar, menu and/or caption of the main window
  /aspectratio          - used for /resize and /resample, keep image proportions
  /info=txtfile         - write image infos to "txtfile"
  /append=tiffile       - append image as (TIF) page to "tiffile"
  /multitif=(tif,files) - create multipage TIF from input files
  /jpgq=X               - set JPG save quality
  /tifc=X               - set TIF save compression
  /wall=X               - set image as wallpaper
  /extract=(file,ext)   - extract all pages from a multipage file
  /import_pal=palfile   - import and apply a special palette to the image (PAL format)





Important notesbr>
- Only lower case options are supported (don't type any UPPERCASE letters) !

- Input file name (if required) is always the first paramater!

- Use "" for file names with spaces, example: "dummy test file.jpg"

- Write always the FULL paths for file names

- You can combine several options in one command

- Wildcards supported only for /convert, /print and /info

- Maximal command line length is limited by Windows





Example for conversion:

"C:\Program Files\IrfanView\I_VIEW32.eXe"  

i_view32.exe c:\test.bmp /convert=c:\giftest.gif
  => Convert file: 'c:\test.bmp' to 'c:\giftest.gif' without GUI ;-)
  i_view32.exe c:\*.jpg /convert=d:\temp\*.gif
  i_view32.exe c:\*.jpg /resample=(500,300) /aspectratio /convert=d:\temp\*.png
  (Note: supported are all IrfanView read/save formats except audio/video)



Example for slideshow:
  i_view32.exe /slideshow=c:\mypics.txt
  (Note: The file 'c:\mypics.txt' contains, in each line, a name of the image,
         including the full path OR path relative to "i_view32.exe")
  i_view32.exe /slideshow=c:\images\
  i_view32.exe /slideshow=c:\images\*.jpg
  i_view32.exe /slideshow=c:\images\test*.jpg



Example for closeslideshow:
  i_view32.exe /slideshow=c:\mypics.txt /closeslideshow
  => IrfanView will be closed after the last image from 'c:\mypics.txt'



Example for thumbnails:
  i_view32.exe c:\test\image1.jpg /thumbs
  => open 'image1.jpg' and display thumbnails from directory 'c:\test'
  or
  i_view32.exe c:\test /thumbs
  => display thumbnails from directory 'c:\test'



Example for close:
  i_view32.exe /killmesoftly
  => close IrfanView and terminate all instances



Example for pagebr>  i_view32.exe c:\test.tif /page=3
  => Open page number 3 from the multipage image 'c:\test.tif'



Example for cropbr>  i_view32.exe c:\test.jpg /crop=(10,10,300,300)
  => Open 'c:\test.jpg' and crop: x-start=10, y-start=10, width=300, height=300



Example for printbr>  i_view32.exe c:\test.jpg /print
  => Open 'c:\test.jpg', print the image to default printer and close IrfanView
  i_view32.exe c:\test.jpg /print="Printer Name"
  => Open 'c:\test.jpg', print the image to specific printer and close IrfanView
  i_view32.exe c:\*.jpg /print
  => Print all JPGs from "C:\" and close IrfanView



Example for resizebr>  i_view32.exe c:\test.jpg /resize=(300,300)
  => Open 'c:\test.jpg' and resize: width=300, height=300
  i_view32.exe c:\test.jpg /resize=(300,300) /aspectratio
  => Open 'c:\test.jpg' and resize: width = max. 300, height = max. 300, proportional
  i_view32.exe c:\test.jpg /resize=(300,0) /aspectratio
  => Open 'c:\test.jpg' and resize: width=300, height=proportinal
  i_view32.exe c:\test.jpg /resize=(300,0)
  => Open 'c:\test.jpg' and resize: width=300, height=original
  i_view32 c:\test.jpg /resize=(150p,150p)
  => Open 'c:\test.jpg' and resize: width=150%, height=150%



Example for resamplebr>  i_view32.exe c:\test.jpg /resample=(300,300)
  => Open 'c:\test.jpg' and resample: width=300, height=300
  i_view32.exe c:\test.jpg /resample=(300,300) /aspectratio
  => Open 'c:\test.jpg' and resample: width = max. 300, height = max. 300, proportional
  i_view32.exe c:\test.jpg /resample=(0,300) /aspectratio
  => Open 'c:\test.jpg' and resize: width=proportinal, height=300
  i_view32.exe c:\test.jpg /resample=(0,300)
  => Open 'c:\test.jpg' and resample: width=original, height=300
  i_view32 c:\test.jpg /resample=(50p,70p)
  => Open 'c:\test.jpg' and resample: width=50%, height=70%



Example for capturebr>  i_view32.exe /capture=0
  => Capture the whole screen and show the image in IrfanView
  i_view32.exe /capture=1
  => Capture the foreground window and show the image in IrfanView
  i_view32.exe /capture=2
  => Capture the client area of the foreground window and show the image



Example for inibr>  i_view32.exe /ini
  i_view32.exe c:\test.jpg /ini
  i_view32.exe c:\test.jpg /ini="c:\temp\"



Example for clipboard pastebr>  i_view32.exe /clippaste
  i_view32.exe /clippaste /convert=c:\test.gif



Example for clipboard copy:
  i_view32.exe c:\test.jpg /clipcopy
  i_view32.exe c:\test.jpg /clipcopy /killmesoftly



Example for /invert:
  i_view32.exe c:\test.jpg /invert



Example for /dpi:
  i_view32.exe c:\test.jpg /dpi=(72,72)



Example for /scan:
  i_view32.exe /scan
  i_view32.exe /scan /convert=c:\test.gif



Example for /batchscan=(options):
  options = all 8 options from the batch scan dialog:
  filename, index, increment, digits, skip, dest-folder, save-extension, multi-tif
  i_view32.exe /batchscan=(scanfile,1,1,2,1,c:\temp,bmp,0)
  i_view32.exe /batchscan=(scanfile,1,1,2,0,c:\temp,tif,1)



Example for /bpp:
  Example: i_view32.exe c:\test.jpg /bpp=8
  Supported BPP-values: 1, 4, 8 and 24 (decrease/increase color depth)
  => Open 'c:\test.jpg' and reduce to 256 colors



Example for /filepattern:
  i_view32.exe c:\images\ /thumbs /filepattern="*.jpg"
  => Go to folder "c:\images\" and show JPG thumbnails only
  i_view32.exe c:\images\ /thumbs /filepattern="123*.jpg"
  => Go to folder "c:\images\" and show JPG names "123*" as thumbnails



Example for /sharpen:
  i_view32.exe c:\test.jpg /sharpen=33



Examples for /hide:
  Values (can be combined (add values)):
    Toolbar     1
    Status bar  2
    Menu bar    4
    Caption     8
  i_view32.exe c:\test.jpg /hide=1
  => Open 'c:\test.jpg', hide toolbar only
  i_view32.exe c:\test.jpg /hide=3
  => Open 'c:\test.jpg', hide toolbar and status bar
  i_view32.exe c:\test.jpg /hide=12
  => Open 'c:\test.jpg', hide caption and menu bar
  i_view32.exe c:\test.jpg /hide=15
  => Open 'c:\test.jpg', hide all



Examples for /info:
  i_view32.exe c:\test.jpg /info=c:\test.txt
  i_view32.exe c:\*.jpg /info=c:\jpgs.txt



Example for /append:
  i_view32.exe c:\test.jpg /append=c:\test.tif
  => Open 'c:\test.jpg' and append it as page to 'c:\test.tif'



Example for /multitif:
  Syntax: /multitif=(tifname,file1,...,fileN)
  First file is the name of the result TIF file.
  i_view32.exe /multitif=(c:\test.tif,c:\test1.bmp,c:\dummy.jpg)
  => Create multipage TIF (c:\test.tif) from 2 other files



Example for /jpgq:
  i_view32.exe c:\test.jpg /jpgQ=75 /convert=c:\new.jpg
  => Open 'c:\test.jpg' and save it as c:\new.jpg, quality = 75
  Quality range: 1 - 100.



Example for /tifc:
  i_view32.exe c:\test.jpg /tifC=4 /convert=c:\new.tif
  => Open 'c:\test.jpg' and save it as c:\new.tif, compression = Fax4
  Compressions: 0 - None, 1 - LZW, 2 - Packbits, 3 - Fax3, 4 - Fax4, 5 = Huffman,
  6 - JPG, 7 - ZIP



Example for wallpaper:
  i_view32.exe c:\test.jpg /wall=0
  => Open 'c:\test.jpg' and set is as wallpaper (centered)
  i_view32.exe c:\test.jpg /wall=1
  => Open 'c:\test.jpg' and set is as wallpaper (tiled)
  i_view32.exe c:\test.jpg /wall=2
  => Open 'c:\test.jpg' and set is as wallpaper (stretched)



Example for /extract:
  i_view32.exe c:\multipage.tif /extract=(c:\temp,jpg)
  => Open 'c:\multipage.tif' and save all pages to folder 'c:\temp' as JPGs

--------------------------------------------------------------------------------

TOP

 

re:哈哈,介绍详尽,我看晕了

哈哈,介绍详尽,我看晕了

TOP

 

re:合小图可以,大图就不行了

合小图可以

,大图就不行了

TOP

 

re:版主果然高手 :D

版主果然高手 

TOP

 

re:大图生成不了

大图生成不了

TOP

 

re:牛

TOP

 

re:动手 太重要了

动手 太重要了

TOP

 

re:我看晕了,版主是高手。

我看晕了,版主是高手。

TOP

 

re:高手,生成个全国的影像贴图共大家可以看到...

高手,生成个全国的影像贴图共大家可以看到图片的同时可以看到地图,最好是地的透明度可调的

TOP

 

re:http://www.onlinedow...

http://www.onlinedown.net/soft/52016.htm



主界面



新建任务



图片拼接



超大图拼接


TOP

 

re:发贴挣陨石

发贴挣陨石

TOP

 
1/2页12 跳转到
回复该主题 发表新主题
  <<上一主题 | 下一主题>>