How to compress image for website?

Joined
Apr 25, 2021
Messages
2
Reaction score
0
I want to know that how to compress image in php and js for upload on a server and minimize the time of client side loading.....
 
Joined
Mar 3, 2021
Messages
240
Reaction score
30
Any image editor can resize and compress an image (MS Paint in Windows, Perview in OS X, a plethora on Linux). Start with the full size, switch the codec to PNG, and see if it's small enough. If it's not small enough, and the image will be displayed smaller, you can shrink or crop the image as needed. If that's still not small enough, I'd recommend creating a thumbnail and then using a JavaScript library to perform fullscreen-on-click type image interaction so they can load small thumbnails at first and only load the big stuff when they're going to use it; this is commonly done for photography or science data sites that have galleries that people click around.
 
Joined
Apr 25, 2021
Messages
2
Reaction score
0
Any image editor can resize and compress an image (MS Paint in Windows, Perview in OS X, a plethora on Linux). Start with the full size, switch the codec to PNG, and see if it's small enough. If it's not small enough, and the image will be displayed smaller, you can shrink or crop the image as needed. If that's still not small enough, I'd recommend creating a thumbnail and then using a JavaScript library to perform fullscreen-on-click type image interaction so they can load small thumbnails at first and only load the big stuff when they're going to use it; this is commonly done for photography or science data sites that have galleries that people click around.
Explain about thumblain and js library
 
Joined
Mar 3, 2021
Messages
240
Reaction score
30
A thumbnail is just a small version of an image that's quick to load. A JavaScript library, such as PhotoSwipe, can allow a user to click an image and get a larger version, zoom, pan, etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,056
Messages
2,570,441
Members
47,101
Latest member
DoloresHol

Latest Threads

Top