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

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
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
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
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
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 

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