All posts tagged “images”

Optimize Your Images With Pre-Defined Image Sizes [WordPress Tip]

Optimizing images on a website is a daunting task. You can choose to use fewer images, compressed images, sprites or svg; the list goes on. One place where many WordPress sites get tripped up is in defining image sizes, which is a crucial aspect of optimizing content-heavy sites.

Image sizes are vital because images are automatically created according to the sizes given when images are uploaded. This ensures that even if you have a 3000px wide original image, it is never used if a 600px image is enough. Ideally a 600px wide space should use a 600px wide image instead of scaling down a larger one.

In this article I’ll walk you through what image sizes are and how to define them.

How WordPress Handles Images

If you’ve ever inserted an image in a WordPress article you should have come by the image size selector. This lets you insert small, medium and large versions of the images. The actual sizes for these can be modified in the WordPress settings.

Whenever you upload an image through WordPress, it generates versions of these images and stores them separately. For example, if you upload a 1200×800 image, WordPress may create 100×100, 600×400 and 900×600 versions. When you insert an image and choose "medium" the actual medium version will be used, as opposed to a shrunk down version of the original.

This is hugely beneficial because it conserves bandwidth on the server and processing time on the client computer. I think it comes as no surprise that downloading a 600×400 image is faster than downloading a 1200×800 image.

If a larger image is used which needs to be scaled down, the browser needs to take care of the calculations to make this happen. While this won’t take hours, it may be noticeable on image-heavy websites.

The Right Image In The Right Place

The ultimate goal should be to always use appropriate image sizes. If you need a 440×380 image, then grab an image with that exact size from the server. There are two main places where you’ll be using uploaded images: featured images and in-post images – I would advise focusing on featured images first.

In all but the most visually directed articles it doesn’t really matter if an in-post image is 220px or 245px wide. Whichever version you have available would be equally usable. Featured images however are usually shown at common sizes. For article lists you may use a 178×178 thumbnail, for article headers you may use a 1200×600 wide image.

In addition to these you may also want to keep a separate thumbnail / medium / large size as defined in the settings to give you easy access to specific dimensions when adding images to posts.

So what it all boils down to is this: Wouldn’t it be great if we had two extra image sizes which we could use for featured images? These image sizes would be created right alongside the rest when an image is uploaded. The good news is that WordPress has you covered with a pretty simple function.

Creating Image Sizes

By using the add_image_size() function you can define all the image sizes your website needs. Let’s create the two examples mentioned above. Place the code below in your theme’s functions.php file or in a plugin’s file.

 add_image_size( 'featured_thumbnail', 178, 178, true ); add_image_size( 'featured_wide', 1200, 600 ); 

As you can see, this function takes four parameters. The first parameter allows you to set a name for the size. The second parameter is the maximum width, the third, the maximum height. The fourth parameter sets hard cropping. If set to true, the image will be created at the exact size you specify.

Once this has been added to your theme or plugin two new versions of each file you upload will be created by WordPress.

Using Image Sizes

These image sizes can be used in a number of functions which deal with retrieving media. Let’s look at featured images first. the_post_thumbnail() is commonly used to display a post’s featured image. The following code can be placed in a WordPress loop:

 the_post_thumbnail( 'featured_thumbnail' ); 

The first parameter of this function allows you to specify the image size to use. Since I’ve specified "featured_thumbnail", the 178×178 version of this file will be used.

There are a number of other functions such as wp_get_attachment_image()and wp_get_attachment_image_src() which also use the image size parameter. Whenever you use such a function you should always specify an appropriate image size.

Regenerating Thumbnails

If you already have a site in place, you won’t be able to optimize your articles retrospectively just by defining an image size. Image sizes are only taken into account when a new image is uploaded, so they are not applied to images already in the system.

Fear not, the Regenerate Thumbnails plugin will make things all better! This plugin can regenerate the thumbnails for all your images, taking into account all defined image sizes. It can also target a specific image, which is useful if you just have a few, or you’re doing some testing.

Once your thumbnails are regenerated you should see the optimized versions loaded on your site. You can check this out by viewing the source of the image. If you uploaded ‘example.jpeg’ and you see ‘example.jpeg’ as the source for your featured image, something isn’t right. If you see “example-178×178.jpeg” then all is well; the optimized image is shown.

Responsive Images

One difficulty in maintaining an optimized site is responsiveness. When I view an article on the iPad an in-post image of a large size will be downscaled since the maximum width will be 786px or so.

The easiest solution is to use a plugin like Hammy. Hammy works based on the content width of your theme (as opposed to the window width of the browser) and can serve optimized images based on that. This is especially handy for mobile users where processing power and bandwidth may be an issue.

Further Image Optimization

As I mentioned in the introduction there are countless ways to optimize images. From sprites to image compression a lot of techniques can be used to decrease the load times which come hand in hand with images. Ashutosh KS has written a great article showcasing 9 WordPress Plugins To Improve Image Performance, I suggest giving it a read!

I also suggest taking a look at Hassle Free Responsive Images which shows you how to add support for the picture element, something you’ll want to use if you want to write your own code.

You won’t believe these Brothers Grimm-inspired images are real

Read more about You won’t believe these Brothers Grimm-inspired images are real at

Schönberger hopes his photography series will inspire calm in an overstimulated world

Creative Bloq

Weevmee Captures a Year in One Image: A new technology from design agency HUSH artistically weaves personal Instagram images

Weevmee Captures a Year in One Image

Leading up to new year’s eve, social media sites fill up with flipbook-like posts compiling the best of users’ years. As a more artistic option, drawing upon the colors and tones of the last 365 days, NYC-based design agency HUSH developed Weevmee;……

Continue Reading…

Cool Hunting

20 Websites To Find Free High-Quality Images

Chances are you’re pretty tired of seeing traditional stock photos of people in suits shaking hands. Not only are they bland and uninteresting, but they also cost money. The good news is that there has been a rise in great stock photo sites that you can use for free – yes, for both personal and commercial use.

In this showcase I put together a collection of 20 sites with beautiful free stock photos that you can choose from. Hopefully, they will help you to spice up your future designs. Do read the licenses carefully though as some of these services and photos may require proper attribution.


Compfight is an image search engine. You can use it to look for the images that you need quickly. If you want a little demonstration, just click on the ‘show me what compfight can do’ button.

Life of Pix

Life of Pix lets you grab free high resolution images with no copyright restrictions. New photos are also added weekly to give you an array of choices.


Superfamous provides you with free stock photos available for download in high resolution. What’s great about it is that you can search under different collections. You may use them as you like as long as credit is provided.

IM Creator Free

IM Free is a new feature of IM Creator. It’s a curated collection of free resources for commercial use. Make sure to read the license of each image before using as some photos may require attribution.


If you’re looking for pictures with a different point of view, you can give this one a go. Here you’ll find free mobile photos for personal and commercial projects.


All of the images on the website are taken by Thomas Mühl and are free of copyright restrictions. You can search for what you need via the categories located at the bottom of the page.

Lock & Stock Photos

All the images you see on Lock & Stock Photos are the works of AJ Montpetit. He is giving back to the open source community (which he greatly admires) by sharing his photographs under the Creative Commons License ShareAlike 4.0.

Snapwire Snaps

This Tumblr blog with free stock photos is run by Snapwire. Snapwire is a site where mobile stock photographers can submit their photos to answer various requests made by others. Snapwire Snaps provides 7 new photos every week.

New Old Stock

New Old Stock is a site curated and created by Cole Townsend. The idea behind this project is to publish old retro photos from Public Archives which are free of known copyright restrictions. So if you’re looking for more retro photos for your project, you know where to look at.


Jeshoots is another great site with free high-quality stock photos. You can use the search bar to find what you need or have a browse under categories which features people, animals, food and architecture among other things. If you’re unsure about anything, you can take a look at the FAQ section.


All the images you’ll find on Cupcake are captured by Jonas Nilsson Lee. There may not be as many choices compared to some of the other sites but you can choose from scenery, landscape, objects and animals.


Kaboompics is a great place to find breathtaking photos for your design projects. You can use the regular search box, look via tags or look under the different categories featured at the top to find the best picture. A new photo is added daily.

Foodies Feed

This site is definitely one that’s made for foodies. Here you’ll find delectable pictures of food. To browse through the free stock photo options, take a look under ‘Free Download’ at the side menu.

Jay Mantri

This lovely site is run by a photographer and traveler Jay Mantri. He uploads 7 new photos every Thursday, so there’s plenty to choose from.

Get a free high resolution photo each day with no attribution required from The names on the photos are pretty generic so you may want to use the category or search option to find things easily.


Raumrot features a selection of photos that have been curated and handpicked for our convenience. There are plenty of different photos to choose from but make sure to give credit to the creator.


Here’s another stock photo site that delights. Instead of just searching by categories or licenses, you can also search via the dominant color featured in the pictures. Definitely a handy thing for designers looking to save some time.

Public Domain Archive

Public Domain Archive is not specifically a free stock photo site but they do have an extensive collection of free stock photos without copyrights. With new uploads weekly, you will surely find something that catches your fancy.

Startup Stock Photos.

This Tumblr blog is a selection of high-quality stock photos for personal and commercial use. As the name itself suggests, this would be especially helpful for startups. And yes, the photos are free.

Photo Pin

Photo Pin is a collection of photos under the Creative Commons license from Flickr. Just type what you’re looking for in the search bar and it will show you all the different results and you can even sort them according to recent, relevance and "interestingness".

Exclusive Cindy Sherman “Film Stills” Tray : Sundance Institute collaborates with the iconic photographer for a limited edition piece, featuring one of her most elusive images

Exclusive Cindy Sherman

Cindy Sherman is decidedly one of the greatest American photographers, with her repertoire including some of the most expensive photographs ever sold. So it is no surprise that the Sundance Institute, with its mission to support great achievements……

Continue Reading…

Cool Hunting

The most detailed nerve images ever recorded are also the most psychedelic

New imaging technique reveals the intricate paths of nerve endings

Continue reading…

The Verge – All Posts

9 eye-popping images created purely in CSS3

Read more about 9 eye-popping images created purely in CSS3 at

The days when you needed an image editor such as Photoshop or Fireworks to create visuals to use on your web page are drawing to a close. It’s now possible to create icons, logos and graphics entirely in CSS3 markup, as these inspirational experiments show.

Creative Bloq

50 festive stock images to download for free

Read more about 50 festive stock images to download for free at

You can download 50 festive themed images right now – for free!

Creative Bloq

First Lumia with Microsoft branding spotted in leaked images

Microsoft revealed its plans to drop the Nokia moniker on its Lumia smartphones last month, and it appears that a new device with the new Microsoft Lumia branding is on the way soon. Images from Chinese regulator TENAA show a new Lumia handset with Microsoft branding at the front and rear in what appears to be a bigger version of the Lumia 530. The new device is simply labelled RM-1090 for now, but it offers dual-SIM support with what will likely be low-end specifications.

As part of Microsoft’s official announcement, the company did hint that a new Lumia would be launching soon. This new handset appears to be the latest low-end Windows Phone from Microsoft, an approach that the company is using to try and push the overall operating…

Continue reading…

The Verge – All Posts

Mick Rock: EXPOSED: The photographer’s iconic images in a Kate Moss-clad paperback book and on view in a coinciding NYC exhibition

Mick Rock: EXPOSED

Mick Rock’s 256-page paperback version of “Exposed” is currently stuck in customs, but that hasn’t made the legendary rock’n’roll photographer slow down. As…

Continue Reading…

Cool Hunting