Contact Us

WebSenor Pvt Ltd Bengaluru

Site No. 26 Laskar, Hosur Rd, Bengaluru, Karnataka 560029
Phone +91-8854834560

WebSenor Pvt Ltd Udaipur

3rd Floor , S.M. Lodha Complex,
Udaipur (Rajasthan)India

Phone: +91-9950834560
Phone+91-9782177208 
Emailinfo@websenor.com

USA – WebSenor LLC

25-03 83rd St, East Elmhurst, NY 11370, United States
Phone: +1-480-561-4112
Emailinfo@websenor.com

UK – WebSenor Ltd

184 Caroline St, Birmingham B3 1UE, UK
Phone+44 20 3286 4560
Emailinfo@websenor.com

WestoWeb Inc

Block 10, Salmiya, Kuwait
Phone+965-97487871
Emailinfo@websenor.com

Skype: WebSenor Infotech

Career

For Career / HR related queries : +91 85297 34560
For Recruitment related queries : +91 83068 92560

WebSenor is a high end tech company headquartered in AZ, USA and its development centers are in Udaipur & Bangalore, India. We provide web development, software development, mobile application development & digital marketing services to the global market.
With 10+ years of experience, 3000+ projects of portfolio and 110+ professionals, WebSenor is one of the leading name in IT market.

Connect with us

How-to optimize JPEG images for websites

How-to optimize JPEG images for websites

Even if internet connections becoming faster and faster, it’s still important to keep your website as fast as possible. One of the “slow” parts of your website are the images. In this article we show several ways to compress photos and JPEG images for your website.

How to compress photos?

If you build your website, you should compress your photos, banners and most other web elements. Your favorite image editor should have some function to down-size your images. For this article we compare 4 ways to compress our example photo (original file-size 393KB):

Adobe Photoshop

If you use the “Save for web…” function it’s possible to create a web optimized version from your image that is small enough and has a quality which is good enough for your website. In our example we used the preset “High Quality” which is equal to 60% quality. The result is a smaller file with a file-size of 95KB.

Adobe Fireworks

Fireworks is my favorite web image editor because of the unique feature to have bitmap and vector elements in a single file. We did an export with 80% quality and the compressed version has a file-size of 85KB.

GIMP (free Image Editor)

Both Adobe products are not free and are only available for Windows or Mac. If you need a free editor you should try Gimp, an Image editor which many functions like the other commercial products mentioned before. The editor has also a “Safe for web” function and we used and 86% quality for our export file which becomes a size of 87KB. If you use GIMP to down-size your photos from your digital camera you should check the option “Strip EXIF”, removing the photo’s meta data will make the file smaller for another ~10KB.

ImageMagick (command line tools)

Our last option is ImageMagick a Linux command line tool. Using the following command the file is down-sized using an 80% quality (file size after conversion is 89KB): convert original_100.jpg -quality 80 imagemagick_80.jpg Sure this method works different from the other methods but the good point is that you can use this code in your PHP scripts or just from the command line of your web server.

Original image and compressed copies

Check the images below and note that the quality for the compressed images (file 2-5) is very similar.

The results after the photo compression is very similar and the file size is between 85KB (fireworks) and 95KB (Photoshop). If you’re looking to down-size another 5-10%, you should try Smush.it a free service from Yahoo. They offer a tool which is able to optimize your images for 5-10% smaller file size without to lower the grade of quality.

Optimize your JPEG images with ImageMagick and PHP

If you need to optimize the images for your existing website, the following PHP code might be useful:

Just enter the path to the the directory you like to optimize safe the code as a PHP script and execute the file from the command line of browser. Using this PHP script, only the photos (JPEG files) are getting compressed. Compress your photos to make them load faster, but be careful don’t compress your images too much.

Leave a Reply

Your email address will not be published. Required fields are marked *