Code Monkey home page Code Monkey logo

image-resizer's Introduction

Bash Script Image Resizing with ImageMagick

This script is used for creating different sized images that integrate nicely with social media websites. I became quite tired of using finder to resize and resample images for web development projects. Hopefully this tool can help you out as it helps me.

Installation

git clone https://github.com/mavieth/image-resizer.git
cd image-resizer/

Running

  • Drop images that need resized into project root
  • Run script
  • Profit
sh build.sh

Before

├── README.md
├── build.sh
├── macbook.jpeg
├── new-york.jpeg
├── dist/
└── originals/

After

├── README.md
├── build.sh
├── dist/
│   ├── macbook-1024x512.png
│   ├── macbook-1200x628.png
│   ├── macbook-1920x1080.png
│   ├── macbook-300x200.png
│   ├── macbook-600x400.png
│   ├── macbook-original.png
│   ├── new-york-1024x512.png
│   ├── new-york-1200x628.png
│   ├── new-york-1920x1080.png
│   ├── new-york-300x200.png
│   ├── new-york-600x400.png
│   └── new-york-original.png
└── originals/
    ├── macbook.jpeg
    └── new-york.jpeg

Sharing

These are sizes used for sharing posts on your site or for linking things such as Twitter Cards and Facebook Cards.

Site Type Size
Facebook & LinkedIn Square 1200x1200
Facebook & Twitter Landscape 1200x627
Pinterest & Google+ Portrait 736x1128

General Sizing

These are sizes used in general (not entirely sure what that means) on various social media outlets.

Site Image Size (pixels)
Facebook 1200x628
Twitter 1024x512
LinkedIn 700x400
Google+ 800x1200
Pinterest 735x1102
Instagram 1080x1080

Adjust Cropping

ImageMagick has well documented parameters that can be interchanged in this script to provide different functionality. (keep image aspect ratio, crop, add background, etc.)

Credits

Contributors are welcome, open up a pull request!

image-resizer's People

Contributors

mavieth avatar

Watchers

Parker Jones avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.