ImageMagick
이미지 매직(ImageMagick)은 그래픽 이미지를 새로 만들거나, 고치는 데 사용되는 자유 소프트웨어이다. 이미지 매직은 대부분의 이미지 형식을 읽고, 변환하거나 쓸 수 있다. 이미지의 외곽을 자르거나, 색을 바꾸는 것을 비롯한 다양한 효과를 줄 수 있으며, 이미지의 회전, 합치기, 문자삽입, 선, 다각형, 타원, 베지에 곡선을 그려넣거나, 이미지 늘이기 등의 작업을 할 수 있다.
ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PNG, Postscript, SVG, and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.
The functionality of ImageMagick is typically utilized from the command line or you can use the features from programs written in your favorite language. Choose from these interfaces: G2F (Ada), MagickCore (C), MagickWand (C), ChMagick (Ch), ImageMagickObject (COM+), Magick++ (C++), JMagick (Java), L-Magick (Lisp), Lua, NMagick (Neko/haXe), Magick.NET (.NET), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (PHP), IMagick (PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a language interface, use ImageMagick to modify or create images dynamically and automagically.
ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you may use, copy, modify, and distribute in both open and proprietary applications. It is distributed under the Apache 2.0 license, approved by the OSI and recommended for use by the OSSCC.
How to Install
CentOS에서는 아래와 같이 설치하면 된다.
Example
- OpticalCharacterRecognition:Example:JpgToPdf: OCR을 사용하여 JPEG파일 목록을 PDF로 변환하는 방법.
- Favicon:Example:AutoGenerateScript: convert를 사용한 favicon 자동 생성 bash스크립트.
Example of the JPEG quality Convert
- Download: Imagemagick_-_jpeg_convert_sample.zip
ImageMagick
를 사용하여 JPEG 품질을 일괄적으로 변환하는 Windows 배치파일 샘플코드는 아래와 같다.
SET MGD_IMAGE_DIR=.\convert_image
SET CONVERTER_NAME=convert.exe
SET CONVERTER_OPTION=-resize 260x350 -quality 92 -depth 24
SET TEMP_DIR=.\.temp
SET OUTPU_EXT=.jpg
SET OUTPUT_FILE=mgd-search.ggii
IF NOT EXIST "%TEMP_DIR%" MKDIR "%TEMP_DIR%"
FOR /R "%MGD_IMAGE_DIR%" %%i IN (*.jpg *.JPG) DO "%CONVERTER_NAME%" %CONVERTER_OPTION% "%%i" "%TEMP_DIR%\%%~ni%OUTPU_EXT%"
Concat image
아래와 같은 방법으로 이미지를 연결할 수 있다.
For vertical stacking (top to bottom):
For horizontal stacking (left to right):
Convert format
간단한 포맷변환은 INPUT과 OUTPUT만 넘겨줘도 된다.
명시적인 방법:
Crop Image
then you could do it with (width
x height
+ left
+ top
/ w
xh
+l
+t
format):
아이콘 파일 만드는 방법
그 밖의 참고용 커맨드 목록:
convert -background transparent -define 'icon:auto-resize=16,24,32,64' logo.svg favicon.ico
convert -transparent white -format ico -resize 64x64 logo.svg favicon.ico
이미지 회전
See also
- Cascade - GPU가속되는 노드 기반 이미지 에디터
- ImaginAIry - AI로 이미지 수정하기
- BackgroundRemover - 이미지/영상에서 배경지우기 오픈소스
- pypipo - 피포페인팅 이미지 자동변환 영상처리 기술
- img2pdf - 이미지를 PDF로 변환.