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 Getting started with Imagemagick

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 Getting started with Imagemagick (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

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Getting started with Imagemagick

  • 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