SlideShare a Scribd company logo
1 of 15
Download to read offline
Introduction
                The absolute basics
   Let’s get a little more advanced




                                  Introduction to ImageMagick

                                          Bart Van Loon


                                        2nd February 2012




1 / 13                                               Bart Van Loon   Introduction to ImageMagick
Introduction
                The absolute basics
   Let’s get a little more advanced




         1 Introduction



         2 The absolute basics



         3 Let’s get a little more advanced




2 / 13                                        Bart Van Loon   Introduction to ImageMagick
Introduction
                The absolute basics
   Let’s get a little more advanced

 Introduction


         ImageMagick®
         ImageMagick is an Open Source software suite to create, edit,
         compose, or convert bitmap images.



                ImageMagick: mind the spelling, and camel-case
                Open Source: Apache 2.0 license (GPLv3 compatible)
                software suite: more than ten binaries
                create, edit, compsose or convert: extremely versatile tools
                bitmap images: over 100 formats supported, but all bitmaps


3 / 13                                           Bart Van Loon   Introduction to ImageMagick
Introduction
                The absolute basics
   Let’s get a little more advanced

 Did I mention extremely versatile?

               features : translate, flip, mirror, rotate, scale, shear and
                        transform images, adjust image colors, apply various
                        special effects, or draw text, lines, polygons, ellipses
                        and Bezier curves, . . .
               bindings : MagickCore (C), MagickWand (C), ChMagick
                        (Ch), Magick++ (C++), JMagick (Java), L-Magick
                        (Lisp), PascalMagick (Pascal), PerlMagick (Perl),
                        MagickWand for PHP (PHP), PythonMagick
                        (Python), RMagick (Ruby), TclMagick (Tcl/TK),
                        ...
             platforms : runs on all major operating systems

         We will focus on simple command line usage.

4 / 13                                            Bart Van Loon   Introduction to ImageMagick
Introduction
                The absolute basics
   Let’s get a little more advanced

 Overview of some of the binaries


              animate : animates an image or image sequence
              compare : annotates the difference between images
         composite : overlaps one image over another
              conjure : executes scripts in the Magick Scripting Language
              convert : converts between image formats and much more
              display : displays an image or image sequence
            identify : describes the characteristics of image files
                import : saves any visible area and outputs it as an image file
              mogrify : is like convert but works on the original image file
              montage : creates an image by combining several images


5 / 13                                           Bart Van Loon   Introduction to ImageMagick
Introduction
                The absolute basics
   Let’s get a little more advanced

 Conversion of file formats




         Binary to use is convert. Example:

                                   $ convert image.png image.jpg

         It guesses the required format from the target filename extension.




6 / 13                                               Bart Van Loon   Introduction to ImageMagick
Introduction
                The absolute basics
   Let’s get a little more advanced

 Identifying images


         Binary to use is identify. Examples:



         $ identify pic.jpg
         pic.jpg JPEG 170x100 170x100+0+0 8-bit DirectClass 
         7.75KB 0.000u 0:00.000

         $ identify pic.png
         pic.png PNG 960x191 960x191+0+0 8-bit DirectClass 
         104KB 0.000u 0:00.000




7 / 13                                          Bart Van Loon   Introduction to ImageMagick
Introduction
                The absolute basics
   Let’s get a little more advanced

 Changing the size of an image

         Binary to use is convert or mogrify. The switch is -scale:


                $ convert -scale 100x250 pic.png png small.png

         or

                               $ mogrify -scale 100x250 pic.png

         The -scale switch takes a “geometry” as argument. A simple
         “geometry” looks like <W>x<H> where
                     <W> is a width; and
                     <H> is a height.
         One of both can be ommitted!

8 / 13                                             Bart Van Loon   Introduction to ImageMagick
Introduction
                The absolute basics
   Let’s get a little more advanced

 Adding a frame to an image




         Again, convert (or mogrify) can take care of this. Example:
         $ convert -border 2 -bordercolor black pic.png frame.png
         More sexy example:
         $ convert -caption "My latest Polaroid" pic.png 
         -gravity center -background black +polaroid polaroid.png




9 / 13                                       Bart Van Loon   Introduction to ImageMagick
Introduction
               The absolute basics
  Let’s get a little more advanced

 Making a screenshot



          For making screenshots, import is a great tool. Example uses:
               $ import window.jpg 
               # now click on a window with your mouse
               $ import -rotate 30 area.png 
               # now draw a rectangle with your mouse
               $ sleep 5; import -window root all.tiff




10 / 13                                        Bart Van Loon   Introduction to ImageMagick
Introduction
               The absolute basics
  Let’s get a little more advanced

 A real story
          For a project, we needed drawings of various pieces of clothing.
          Our script expected a bunch of .png-files like




11 / 13                                          Bart Van Loon   Introduction to ImageMagick
Introduction
               The absolute basics
  Let’s get a little more advanced

 A real story



          But we only had .pdf-documents that looked like




          Hundreds of them. . .




11 / 13                                       Bart Van Loon   Introduction to ImageMagick
Introduction
               The absolute basics
  Let’s get a little more advanced

 A real story


          So for each .pdf-file we had to:
               convert the .pdf-files to the .png-format;
               cut the original images in two to separate the drawings of the
               front side from those of the back side of the clothing;
               set all the images on a transparent background; and
               fix the filenames of the resulting .png images.
          We did this with a simple ImageMagick script (the loop and file
          renaming was taken care of by bash) which saved both a developer
          and a designer a day of boring, repetitive work.




11 / 13                                          Bart Van Loon   Introduction to ImageMagick
Introduction
               The absolute basics
  Let’s get a little more advanced

 The time saving script




          Now what would this script have looked like, you think?




12 / 13                                         Bart Van Loon   Introduction to ImageMagick
Introduction
               The absolute basics
  Let’s get a little more advanced

 References




               http://imagemagick.org
               http://www.soton.ac.uk/~fangohr/computing/imagemagick.html




13 / 13                                         Bart Van Loon   Introduction to ImageMagick

More Related Content

Similar to Intro ImageMagick Basics Convert Edit Bitmap Images

Om Pawar MP AJP.docx
Om Pawar MP AJP.docxOm Pawar MP AJP.docx
Om Pawar MP AJP.docxOmpawar61
 
Qt and QML performance tips & tricks for Qt 4.7
Qt and QML performance tips & tricks for Qt 4.7Qt and QML performance tips & tricks for Qt 4.7
Qt and QML performance tips & tricks for Qt 4.7Pasi Kellokoski
 
The mag pi-issue-28-en
The mag pi-issue-28-enThe mag pi-issue-28-en
The mag pi-issue-28-enNguyen Nam
 
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?Pin-Ying Tu
 
Immutable Infrastructure & Rethinking Configuration - Interop 2019
Immutable Infrastructure & Rethinking Configuration - Interop 2019Immutable Infrastructure & Rethinking Configuration - Interop 2019
Immutable Infrastructure & Rethinking Configuration - Interop 2019RackN
 
BigML Release: Image Processing
BigML Release: Image ProcessingBigML Release: Image Processing
BigML Release: Image ProcessingBigML, Inc
 
Graphics on the Go
Graphics on the GoGraphics on the Go
Graphics on the GoGil Irizarry
 
IRJET- Transformation of Realistic Images and Videos into Cartoon Images and ...
IRJET- Transformation of Realistic Images and Videos into Cartoon Images and ...IRJET- Transformation of Realistic Images and Videos into Cartoon Images and ...
IRJET- Transformation of Realistic Images and Videos into Cartoon Images and ...IRJET Journal
 
The basics of creating a gif animation
The basics of creating a gif animationThe basics of creating a gif animation
The basics of creating a gif animationLilia Mironova
 
DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.JooinK
 
DIY- computer vision with GWT
DIY- computer vision with GWTDIY- computer vision with GWT
DIY- computer vision with GWTFrancesca Tosi
 
stackconf 2023 | Dynamic Image Optimization with imgproxy at Schwarz IT by An...
stackconf 2023 | Dynamic Image Optimization with imgproxy at Schwarz IT by An...stackconf 2023 | Dynamic Image Optimization with imgproxy at Schwarz IT by An...
stackconf 2023 | Dynamic Image Optimization with imgproxy at Schwarz IT by An...NETWAYS
 
SRECon 18 Immutable Infrastructure
SRECon 18 Immutable InfrastructureSRECon 18 Immutable Infrastructure
SRECon 18 Immutable InfrastructureRackN
 
#SREcon Immutable Infrastructure: rethinking configuration mgmt
#SREcon Immutable Infrastructure: rethinking configuration mgmt#SREcon Immutable Infrastructure: rethinking configuration mgmt
#SREcon Immutable Infrastructure: rethinking configuration mgmtrhirschfeld
 
Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1benDesigning
 
Samuel Asher Rivello - PureMVC Hands On Part 2
Samuel Asher Rivello - PureMVC Hands On Part 2Samuel Asher Rivello - PureMVC Hands On Part 2
Samuel Asher Rivello - PureMVC Hands On Part 2360|Conferences
 
How the hell do I run my microservices in production, and will it scale?
How the hell do I run my microservices in production, and will it scale?How the hell do I run my microservices in production, and will it scale?
How the hell do I run my microservices in production, and will it scale?Katarzyna Hoffman
 

Similar to Intro ImageMagick Basics Convert Edit Bitmap Images (20)

Om Pawar MP AJP.docx
Om Pawar MP AJP.docxOm Pawar MP AJP.docx
Om Pawar MP AJP.docx
 
Qt and QML performance tips & tricks for Qt 4.7
Qt and QML performance tips & tricks for Qt 4.7Qt and QML performance tips & tricks for Qt 4.7
Qt and QML performance tips & tricks for Qt 4.7
 
The mag pi-issue-28-en
The mag pi-issue-28-enThe mag pi-issue-28-en
The mag pi-issue-28-en
 
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
 
Immutable Infrastructure & Rethinking Configuration - Interop 2019
Immutable Infrastructure & Rethinking Configuration - Interop 2019Immutable Infrastructure & Rethinking Configuration - Interop 2019
Immutable Infrastructure & Rethinking Configuration - Interop 2019
 
BigML Release: Image Processing
BigML Release: Image ProcessingBigML Release: Image Processing
BigML Release: Image Processing
 
Mcollective introduction
Mcollective introductionMcollective introduction
Mcollective introduction
 
Graphics on the Go
Graphics on the GoGraphics on the Go
Graphics on the Go
 
IRJET- Transformation of Realistic Images and Videos into Cartoon Images and ...
IRJET- Transformation of Realistic Images and Videos into Cartoon Images and ...IRJET- Transformation of Realistic Images and Videos into Cartoon Images and ...
IRJET- Transformation of Realistic Images and Videos into Cartoon Images and ...
 
The basics of creating a gif animation
The basics of creating a gif animationThe basics of creating a gif animation
The basics of creating a gif animation
 
DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.
 
DIY- computer vision with GWT
DIY- computer vision with GWTDIY- computer vision with GWT
DIY- computer vision with GWT
 
Image forgery and security
Image forgery and securityImage forgery and security
Image forgery and security
 
imgproxy is amazing
imgproxy is amazingimgproxy is amazing
imgproxy is amazing
 
stackconf 2023 | Dynamic Image Optimization with imgproxy at Schwarz IT by An...
stackconf 2023 | Dynamic Image Optimization with imgproxy at Schwarz IT by An...stackconf 2023 | Dynamic Image Optimization with imgproxy at Schwarz IT by An...
stackconf 2023 | Dynamic Image Optimization with imgproxy at Schwarz IT by An...
 
SRECon 18 Immutable Infrastructure
SRECon 18 Immutable InfrastructureSRECon 18 Immutable Infrastructure
SRECon 18 Immutable Infrastructure
 
#SREcon Immutable Infrastructure: rethinking configuration mgmt
#SREcon Immutable Infrastructure: rethinking configuration mgmt#SREcon Immutable Infrastructure: rethinking configuration mgmt
#SREcon Immutable Infrastructure: rethinking configuration mgmt
 
Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1
 
Samuel Asher Rivello - PureMVC Hands On Part 2
Samuel Asher Rivello - PureMVC Hands On Part 2Samuel Asher Rivello - PureMVC Hands On Part 2
Samuel Asher Rivello - PureMVC Hands On Part 2
 
How the hell do I run my microservices in production, and will it scale?
How the hell do I run my microservices in production, and will it scale?How the hell do I run my microservices in production, and will it scale?
How the hell do I run my microservices in production, and will it scale?
 

More from Bart Van Loon

The Perfect Pitch - stage edition
The Perfect Pitch - stage editionThe Perfect Pitch - stage edition
The Perfect Pitch - stage editionBart Van Loon
 
The Perfect Pitch - networking edition
The Perfect Pitch - networking editionThe Perfect Pitch - networking edition
The Perfect Pitch - networking editionBart Van Loon
 
A future for IT professionals (?)
A future for IT professionals (?)A future for IT professionals (?)
A future for IT professionals (?)Bart Van Loon
 
Command line essentials
Command line essentialsCommand line essentials
Command line essentialsBart Van Loon
 
Vi IMproved, a programmers text editor
Vi IMproved, a programmers text editorVi IMproved, a programmers text editor
Vi IMproved, a programmers text editorBart Van Loon
 
Met het hoofd online, maar met de voeten in de Vlaamse klei?
Met het hoofd online, maar met de voeten in de Vlaamse klei?Met het hoofd online, maar met de voeten in de Vlaamse klei?
Met het hoofd online, maar met de voeten in de Vlaamse klei?Bart Van Loon
 
Why study Computer Science?
Why study Computer Science?Why study Computer Science?
Why study Computer Science?Bart Van Loon
 
The Entrepreneurial Engineer
The Entrepreneurial EngineerThe Entrepreneurial Engineer
The Entrepreneurial EngineerBart Van Loon
 
Mission, Vision and Strategy in organisations
Mission, Vision and Strategy in organisationsMission, Vision and Strategy in organisations
Mission, Vision and Strategy in organisationsBart Van Loon
 
Cultural Learnings of Pakistan for Make Benefit Glorious Nation of Belgium
Cultural Learnings of Pakistan for Make Benefit Glorious Nation of BelgiumCultural Learnings of Pakistan for Make Benefit Glorious Nation of Belgium
Cultural Learnings of Pakistan for Make Benefit Glorious Nation of BelgiumBart Van Loon
 
Open Source in your company
Open Source in your companyOpen Source in your company
Open Source in your companyBart Van Loon
 
General introduction to Open Source
General introduction to Open SourceGeneral introduction to Open Source
General introduction to Open SourceBart Van Loon
 

More from Bart Van Loon (14)

The Perfect Pitch - stage edition
The Perfect Pitch - stage editionThe Perfect Pitch - stage edition
The Perfect Pitch - stage edition
 
The Perfect Pitch - networking edition
The Perfect Pitch - networking editionThe Perfect Pitch - networking edition
The Perfect Pitch - networking edition
 
A future for IT professionals (?)
A future for IT professionals (?)A future for IT professionals (?)
A future for IT professionals (?)
 
Command line essentials
Command line essentialsCommand line essentials
Command line essentials
 
Vi IMproved, a programmers text editor
Vi IMproved, a programmers text editorVi IMproved, a programmers text editor
Vi IMproved, a programmers text editor
 
Met het hoofd online, maar met de voeten in de Vlaamse klei?
Met het hoofd online, maar met de voeten in de Vlaamse klei?Met het hoofd online, maar met de voeten in de Vlaamse klei?
Met het hoofd online, maar met de voeten in de Vlaamse klei?
 
Why study Computer Science?
Why study Computer Science?Why study Computer Science?
Why study Computer Science?
 
The Entrepreneurial Engineer
The Entrepreneurial EngineerThe Entrepreneurial Engineer
The Entrepreneurial Engineer
 
Mission, Vision and Strategy in organisations
Mission, Vision and Strategy in organisationsMission, Vision and Strategy in organisations
Mission, Vision and Strategy in organisations
 
Cultural Learnings of Pakistan for Make Benefit Glorious Nation of Belgium
Cultural Learnings of Pakistan for Make Benefit Glorious Nation of BelgiumCultural Learnings of Pakistan for Make Benefit Glorious Nation of Belgium
Cultural Learnings of Pakistan for Make Benefit Glorious Nation of Belgium
 
Open Source in your company
Open Source in your companyOpen Source in your company
Open Source in your company
 
The DataTank
The DataTankThe DataTank
The DataTank
 
General introduction to Open Source
General introduction to Open SourceGeneral introduction to Open Source
General introduction to Open Source
 
DataTank - alpha
DataTank - alphaDataTank - alpha
DataTank - alpha
 

Recently uploaded

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Recently uploaded (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

Intro ImageMagick Basics Convert Edit Bitmap Images

  • 1. Introduction The absolute basics Let’s get a little more advanced Introduction to ImageMagick Bart Van Loon 2nd February 2012 1 / 13 Bart Van Loon Introduction to ImageMagick
  • 2. Introduction The absolute basics Let’s get a little more advanced 1 Introduction 2 The absolute basics 3 Let’s get a little more advanced 2 / 13 Bart Van Loon Introduction to ImageMagick
  • 3. Introduction The absolute basics Let’s get a little more advanced Introduction ImageMagick® ImageMagick is an Open Source software suite to create, edit, compose, or convert bitmap images. ImageMagick: mind the spelling, and camel-case Open Source: Apache 2.0 license (GPLv3 compatible) software suite: more than ten binaries create, edit, compsose or convert: extremely versatile tools bitmap images: over 100 formats supported, but all bitmaps 3 / 13 Bart Van Loon Introduction to ImageMagick
  • 4. Introduction The absolute basics Let’s get a little more advanced Did I mention extremely versatile? features : translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bezier curves, . . . bindings : MagickCore (C), MagickWand (C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (PHP), PythonMagick (Python), RMagick (Ruby), TclMagick (Tcl/TK), ... platforms : runs on all major operating systems We will focus on simple command line usage. 4 / 13 Bart Van Loon Introduction to ImageMagick
  • 5. Introduction The absolute basics Let’s get a little more advanced Overview of some of the binaries animate : animates an image or image sequence compare : annotates the difference between images composite : overlaps one image over another conjure : executes scripts in the Magick Scripting Language convert : converts between image formats and much more display : displays an image or image sequence identify : describes the characteristics of image files import : saves any visible area and outputs it as an image file mogrify : is like convert but works on the original image file montage : creates an image by combining several images 5 / 13 Bart Van Loon Introduction to ImageMagick
  • 6. Introduction The absolute basics Let’s get a little more advanced Conversion of file formats Binary to use is convert. Example: $ convert image.png image.jpg It guesses the required format from the target filename extension. 6 / 13 Bart Van Loon Introduction to ImageMagick
  • 7. Introduction The absolute basics Let’s get a little more advanced Identifying images Binary to use is identify. Examples: $ identify pic.jpg pic.jpg JPEG 170x100 170x100+0+0 8-bit DirectClass 7.75KB 0.000u 0:00.000 $ identify pic.png pic.png PNG 960x191 960x191+0+0 8-bit DirectClass 104KB 0.000u 0:00.000 7 / 13 Bart Van Loon Introduction to ImageMagick
  • 8. Introduction The absolute basics Let’s get a little more advanced Changing the size of an image Binary to use is convert or mogrify. The switch is -scale: $ convert -scale 100x250 pic.png png small.png or $ mogrify -scale 100x250 pic.png The -scale switch takes a “geometry” as argument. A simple “geometry” looks like <W>x<H> where <W> is a width; and <H> is a height. One of both can be ommitted! 8 / 13 Bart Van Loon Introduction to ImageMagick
  • 9. Introduction The absolute basics Let’s get a little more advanced Adding a frame to an image Again, convert (or mogrify) can take care of this. Example: $ convert -border 2 -bordercolor black pic.png frame.png More sexy example: $ convert -caption "My latest Polaroid" pic.png -gravity center -background black +polaroid polaroid.png 9 / 13 Bart Van Loon Introduction to ImageMagick
  • 10. Introduction The absolute basics Let’s get a little more advanced Making a screenshot For making screenshots, import is a great tool. Example uses: $ import window.jpg # now click on a window with your mouse $ import -rotate 30 area.png # now draw a rectangle with your mouse $ sleep 5; import -window root all.tiff 10 / 13 Bart Van Loon Introduction to ImageMagick
  • 11. Introduction The absolute basics Let’s get a little more advanced A real story For a project, we needed drawings of various pieces of clothing. Our script expected a bunch of .png-files like 11 / 13 Bart Van Loon Introduction to ImageMagick
  • 12. Introduction The absolute basics Let’s get a little more advanced A real story But we only had .pdf-documents that looked like Hundreds of them. . . 11 / 13 Bart Van Loon Introduction to ImageMagick
  • 13. Introduction The absolute basics Let’s get a little more advanced A real story So for each .pdf-file we had to: convert the .pdf-files to the .png-format; cut the original images in two to separate the drawings of the front side from those of the back side of the clothing; set all the images on a transparent background; and fix the filenames of the resulting .png images. We did this with a simple ImageMagick script (the loop and file renaming was taken care of by bash) which saved both a developer and a designer a day of boring, repetitive work. 11 / 13 Bart Van Loon Introduction to ImageMagick
  • 14. Introduction The absolute basics Let’s get a little more advanced The time saving script Now what would this script have looked like, you think? 12 / 13 Bart Van Loon Introduction to ImageMagick
  • 15. Introduction The absolute basics Let’s get a little more advanced References http://imagemagick.org http://www.soton.ac.uk/~fangohr/computing/imagemagick.html 13 / 13 Bart Van Loon Introduction to ImageMagick