Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Image Compression?
brad-t Offline
Member
***
Posts: 120
Joined: Apr 2011
Post: #1
Image Compression?
How does xthreads handle image compression when producing thumbnails? Currently my resized pics are looking very grainy though the full-size are very clear. Is there any way to increase the quality?
05-19-2011 01:11 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #2
RE: Image Compression?
What is the full size of your images, and what is the thumbnail size you use?

It doesn't happen to me. You can look at my images gallery here:
http://www.14.mynie.co.cc/forumdisplay.php?fid=53

Or, you can try it here:
http://mybbhacks.zingaburga.com/forumdisplay.php?fid=26

05-19-2011 01:45 AM
Find all posts by this user Quote this message in a reply
brad-t Offline
Member
***
Posts: 120
Joined: Apr 2011
Post: #3
RE: Image Compression?
Produced thumbnail: http://harajuju.net/xthreads_attach.php/...http://harajuju.net/xthreads_attach.php/4_1305678664_c2d9e305/965696d699b331be9dbfbceaf48551cb/mar19_2011.jpg/th

Original: http://harajuju.net/xthreads_attach.php/...http://harajuju.net/xthreads_attach.php/4_1305678664_c2d9e305/965696d699b331be9dbfbceaf48551cb/mar1
05-19-2011 01:47 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #4
RE: Image Compression?
Ugh... I can't see much different. Probably because I'm not a graphics designer.
Does it happens to your thumbnail if you use MyBB attachments?

05-19-2011 02:09 AM
Find all posts by this user Quote this message in a reply
brad-t Offline
Member
***
Posts: 120
Joined: Apr 2011
Post: #5
RE: Image Compression?
Here you can see compressed (top) vs resized in photoshop (bottom). http://i.imgur.com/JdMBU.jpg

Regular MyBB attachments are compressed as well, but they are so small so it doesn't matter ...

I'll ask at MyBB how image compression is handled and if it can be controlled. Thanks!
(This post was last modified: 05-19-2011 02:24 AM by brad-t.)
05-19-2011 02:19 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #6
RE: Image Compression?
What I know is (I can be wrong), XThreads use MyBB's thumbnail generation to create a thumbnail. Again, I can be wrong. I think you need to wait Yumi to answer your question.

05-19-2011 02:33 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #7
RE: Image Compression?
Yes, it uses MyBB's resize functions to do the job.
Note that there's two primary factors affecting quality in scaling:
- scaling algorithm used (I suspect PHP's GD does a simple Bilinear scale)
- for JPEG, there's further quantization applied to the image - this is probably the source of graininess.
http://php.net/manual/en/function.imagejpeg.php
MyBB doesn't supply a quality argument, so it'd be using the default of 75%.  If you wanted better quality, you'd have to edit the imagejpeg calls, including a higher quality (say 90%) - note that this would affect all MyBB thumbnails too

Alternatively, if images are uploaded as PNG, there won't be further quantization, so no further quality reduction.

My Blog
(This post was last modified: 05-19-2011 08:45 AM by ZiNgA BuRgA.)
05-19-2011 08:44 AM
Find all posts by this user Quote this message in a reply
brad-t Offline
Member
***
Posts: 120
Joined: Apr 2011
Post: #8
RE: Image Compression?
Thanks for the details; I got an answer on how to fix on MyBB as well Smile
05-19-2011 10:38 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #9
RE: Image Compression?
Sorry to bring this thread back from the dead - but I also have a question about images compression. I was reading that it is preferred to use progressive.jpgs over baseline and that the  http://www.php.net/manual/en/function.im...http://www.php.net/manual/en/function.imageint  is required. Is this included in the XThreads Image Filtering Chains? I could find no reference to it in the Documentation.


[Image: leelink.gif]
MYBB1.6 & XThreads
03-24-2014 02:02 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #10
RE: Image Compression?
It doesn't set interlacing/progressive mode, so whatever the default is.
Unfortunately, I can't tell what it is from the documentation, because the following statement is contradictory:
Quote:If you want to output Progressive JPEGs, you need to set interlacing on with imageinterlace().

Taking an image from the gallery here seems to show that JPEGs are interlaced.  I doubt you'll get much of a size difference for typical thumbnails though (I got <0.5% size reduction for a quick test image).

If you want to change it yourself though, open inc/xthreads/xt_image.php, and before the line

PHP Code:
imagejpeg($im, $fn, $this->_jpeg_quality);

add

PHP Code:
@imageinterlace($im, false);



I suspect progressive JPEGs aren't as widely supported as interlaced, though it shouldn't be much of an issue with today's web.


My Blog
(This post was last modified: 03-24-2014 09:43 AM by ZiNgA BuRgA.)
03-24-2014 09:31 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: