Member
Member
astorm   2006-04-25, 15:59
#1

In Photoshop, we usually use "Bicubic Sharper" resample to reduce image size. Is it possible to implement some sort of sharpening for the resized images?

Member
Member
aitf311   2006-04-25, 16:44
#2

That would definately make the resized images look nicer but it seems to me that something like sharpening would be very resource hungry....granted I dont know anything about php.

Member
Member
Chilifrei64   2006-04-25, 16:50
#3

From what I just read.. yes.. it is very resource hungry. With that being said.. here is a script that someone created that will do that.. not sure how easy that is to integrate.. Obviously it would be a "hack" of zenphoto to impliment it unless tris decided he wants it.. but here it is

http://vikjavev.no/hovudsida/umtestside.php.

Member
Member
astorm   2006-04-25, 18:16
#4

Good find Chilifrei64!

I was wondering if there are alternative solutions other than GD (ImageMagick, NetPBM, etc) that can do this with less resource usage. Of course, we'd need to figure out how integrate it into ZP =)

Developer
Developer
trisweb   2006-04-25, 20:34
#5

astorm, I always though adding ImageMagick support would be a cinch, mainly because all the image processing is contained nicely in i.php, and you can just do a couple switches and use ImageMagick's functions instead of GD. I've always wanted to see if there's a speed difference, and the extra compatibility is good, so I imagine it will happen someday.

I probably won't add this filter beacuse of speed and personal preference differences, but once we get a good real plugin system, image filters could be added to customize your installation! (that's a ways off though).

Member
Member
xebeque   2006-05-27, 07:08
#6

Since then: How about using a simple sharpening as with image-magick convert? It´s much faster than unsharp mask but provides good results.
I´d tried it if I found the gd code in zen. ANy hint for me?

Developer
Developer
trisweb   2006-05-27, 07:32
#7

It's in i.php -- you're welcome to try an ImageMagick conversion, but it's likely to be difficult... good luck! I'd be happy to help if you have questions, or maybe I'll just try it myself...

Member
Member
xebeque   2006-05-29, 19:43
#8

Well - for me coding is like flying blind - I actually never learnt enough to get any usable results. Thus I give up. But i found the following code which might be helpfull for others:

$sharpenMatrix = array(-1,-1,-1,-1,16,-1,-1,-1,-1);
$divisor = 8;
$offset = 0;
imageconvolution($newim, $sharpenMatrix, $divisor, $offset);

which is said to have a sharpening effect - but i cannot handle it.

I also found a function gdImageSharpen(gdImagePtr im, int pct) (look here http://www.boutell.com/boutell/gdmanualtest.html#gdImageSharpen)
that left me helpless.
I´d have liked to be a more successful contributor to zenphoto

Developer
Developer
trisweb   2006-05-30, 08:46
#9

Nah, it's okay. I probably wouldn't include any of that by default anyway. Leave it for a plugin developer later down the line

Member
Member
xebeque   2006-05-30, 23:22
#10

Maybe somebody else with better coding skills is as impatient as I am...

Developer
Developer
trisweb   2006-05-31, 06:10
#11

Impatient for sharpening? Wow...

Try that convolution matrix in your earlier post again, you just have to do it before any image is saved (with the imagejpeg command). Read up on PHP and the GD image functions, it's not too bad

Member
Member
xebeque   2006-06-02, 19:40
#12

I pasted the exact code from above before imagejpeg (after line 215 in i.php V. 1.0.3 beta).
No more image is shown cause image processing fails somehow: cache shows 0-byte images.

Developer
Developer
trisweb   2006-06-04, 03:05
#13

Ahh, this is called debugging! Check the logs for an error message, or disable the redirect (comment-out the header: Location line) and see what going to i.php?a=album&i=image&s=size directly shows.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.