WordPress Images: Difference between revisions

mNo edit summary
Line 12: Line 12:
WordPress Thumbnails.  Errr, don't you mean 'Alternate Image Sizes'?  Well, yes.  But WordPress life started out referring to them as 'thumbnails'.  A thumbnail being a downsized (as in dimensionally and quality) to a smaller size, which in turn usually represented a link to a larger, full sized image.  That's how it began with WordPress.  And sort of like Max Headroom, the name just sort of stuck, even though it doesn't refer to the same thing anymore.
WordPress Thumbnails.  Errr, don't you mean 'Alternate Image Sizes'?  Well, yes.  But WordPress life started out referring to them as 'thumbnails'.  A thumbnail being a downsized (as in dimensionally and quality) to a smaller size, which in turn usually represented a link to a larger, full sized image.  That's how it began with WordPress.  And sort of like Max Headroom, the name just sort of stuck, even though it doesn't refer to the same thing anymore.


== Compression ==
==Compression==
On the subject of compression, most websites state WordPress compresses JPEG files using the setting of 90%.  That is not true anymore as of early 2022.  I confirmed this by experimenting with the ''add_filter( 'jpeg_quality', create_function( <nowiki>''</nowiki>, 'return 82;' ) );'' setting in the Child Theme ''functions.php'' file and it is 82%.  This author confirms my testing with greater explanation: https://kinsta.com/blog/lossy-compression/ Below is the data (it was a quick test, so not too much data) and a 1066px x 799px Image with a bland background to give the compression program and easy job;
On the subject of compression, most websites state WordPress compresses JPEG files using the setting of 90%.  That is not true anymore as of early 2022.  I confirmed this by experimenting with the ''add_filter( 'jpeg_quality', create_function( <nowiki>''</nowiki>, 'return 82;' ) );'' setting in the Child Theme ''functions.php'' file and it is 82%.  This author confirms my testing with greater explanation: https://kinsta.com/blog/lossy-compression/ Below is the data (it was a quick test, so not too much data) and a 1066px x 799px Image with a bland background to give the compression program and easy job;
[[File:Skills JPEG 1066px x 799px.jpg|alt=Skills JPEG - 1066px x 799px|thumb|Skills JPEG - 1066px x 799px]]
[[File:Skills JPEG 1066px x 799px.jpg|alt=Skills JPEG - 1066px x 799px|thumb]]
<br /><syntaxhighlight lang="text">
<br /><syntaxhighlight lang="text">
Original JPEG / JPG Image File Size (100% Quality): 56.4 KB (57,795 bytes as reported by Windows)
Original JPEG / JPG Image File Size (100% Quality): 56.4 KB (57,795 bytes as reported by Windows)
Line 33: Line 33:
Not until 93% Quality does the compression setting equal the original file size.
Not until 93% Quality does the compression setting equal the original file size.
</syntaxhighlight>
</syntaxhighlight>
[[File:Modern Art JPEG 2048px X 2048px.jpg|alt=Modern Art JPEG 2048px X 2048px|left|thumb|Modern Art JPEG 2048px X 2048px]]
[[File:Modern Art JPEG 2048px X 2048px.jpg|alt=Modern Art JPEG 2048px X 2048px|left|thumb]]
But wait!  That was an attention getter.  What if the original file was already compressed?  That would account for the odd compressing numbers, right?  How about an original piece of Modern Art exported as a JPEG at 100%?  Here's the data;<syntaxhighlight lang="text">
But wait!  That was an attention getter.  What if the original file was already compressed?  That would account for the odd compressing numbers, right?  How about an original piece of Modern Art exported as a JPEG at 100%?  Here's the data;<syntaxhighlight lang="text">
Original JPEG / JPG Image File Size (100% Quality): 479 KB
Original JPEG / JPG Image File Size (100% Quality): 479 KB
Line 39: Line 39:
100% Quality File Size: 232 KB
100% Quality File Size: 232 KB
82% Quality File Size: 85.8 KB
82% Quality File Size: 85.8 KB
</syntaxhighlight>Phew!  Sanity restored.  But it is something to watch out for.  If you've got a JPEG File that's already compressed, WordPress will compress it further.  After about 10 uploads and downloads, it's gonna look a little fuzzy.  So be careful where you get your JPEGs from.  Don't just steal them.  Steal them, then edit them.  Just kidding. : )
</syntaxhighlight>Phew!  Sanity restored.  But it is something to watch out for.  If you've got a JPEG File that's already compressed, WordPress will compress it further.  After about 10 uploads and downloads, it's gonna look a little fuzzy.  So be careful where you get your JPEGs from.  Don't just steal them.  Steal them, then edit them.  Just kidding. <span> </span>: )


Thanks to this website (http://regex.info/blog/lightroom-goodies/jpeg-quality) it is easy to discern for one's self (instead of taking my word or anyone else who writes an opinion on JPG Compression) how a gradient becomes visible to the human eye around 80% compression.  They also include a bar graph that shows the file size.  In the end, it seems evident the WordPress guys really did their homework and figured out that 82% is just about the perfect medium for Quality / Size.  Good job guys! (I'm using the term 'guys' in a non-gender fashion)
Thanks to this website (http://regex.info/blog/lightroom-goodies/jpeg-quality) it is easy to discern for one's self (instead of taking my word or anyone else who writes an opinion on JPG Compression) how a gradient becomes visible to the human eye around 80% compression.  They also include a bar graph that shows the file size.  In the end, it seems evident the WordPress guys really did their homework and figured out that 82% is just about the perfect medium for Quality / Size.  Good job guys! (I'm using the term 'guys' in a non-gender fashion)
Line 112: Line 112:
Real Media Library: Seems to add EXIF Data when uploading files.
Real Media Library: Seems to add EXIF Data when uploading files.


WARNING: Haven't figured out which plugin did it, possibly Media Library Assistant (NOPE, checked it on another site, and that wasn't the one responsible), but a plugin added a BUNCH of columns to the the "Media Database", including EXIF, etc.  The Smush Plugin does the same thing.  It's fairly normal for a plugin to do this AND leave all the data behind (just in case one needs it in the future if the plugin is reinstalled)<br />
WARNING: Haven't figured out which plugin did it, possibly Media Library Assistant (NOPE, checked it on another site, and that wasn't the one responsible), but a plugin added a BUNCH of columns to the the "Media Database", including EXIF, etc.  The Smush Plugin does the same thing.  It's fairly normal for a plugin to do this AND leave all the data behind (just in case one needs it in the future if the plugin is reinstalled)
 
=== Services ===
There are also a bunch of image related plugins from ShortPixel, along with what seems like dozens more, that have 'free' plugins (IE, there is no 'pro' version), and instead sell a service.  Interesting concept in that they make their plugin a 'thin-net' client that then sends an original image off to a server to be manipulated (resized, cropped, format changed, etc.).  That has the advantage of reducing CPU usage on a server, but it has a downside of using up valuable bandwidth to upload large images and then download them again.  In strict terms of time, tried a quick test with a couple of services that offered a free trial and discovered it was faster to deal with the minuscule CPU hit instead of all the time it took to upload the file, have it processed, then download everything (network, CPU, and disk access time all came into play).  Of course the testing was done using a huge image file and that would seem to be similar to using a bunch of smaller files.  It's an interesting angle and of course the sellers are going to point out all the benefits.  But of course they're the ones benefiting too by selling a subscription.  My choice?  Keep it 'in house'.


==Summary==
==Summary==