LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-13-2007, 04:33 AM   #1
nkoplm
Member
 
Registered: May 2005
Distribution: Fedora
Posts: 92

Rep: Reputation: 15
php gd - destaturate


I am trying to write a php script that will (among other things), desaturate an image by 60% ( not all the way to greyscale )

I have been looking all over for an answer but cannot find one. I am pretty sure there is no built in functionality to do this in gd, so it would have to be a custom function, but i dont know the colour theory enough to program the math for it.

(I realize that this is a bit of a specific and obscure question, so even if you dont know the answer, if you could suggest a better place to ask for help (a PHP centric forum?), that would be appreciated too.)
 
Old 05-13-2007, 07:57 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Hi

I've never had that exact problem, but I've done some obscure image processing with PHP before. First, you cannot do much with gdlib. PHP is not good for pixel wise processing, so we need tools. Try this:

http://www.imagemagick.org/script/index.php

My advice is first to try to solve the problem on the command line. If it scales badly executing commands in the script, there is a PHP module. On my system it's called "php4-imagick".

Warning:
ImageMagick is progressing fast. So it tends to being incompatible with old versions. They forked into "GraphicsMagick" for that reason.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Are PHP session variables held in memory when you leave a PHP site? Locura Programming 11 11-16-2008 08:37 PM
You have chosen to open index.php which is a : PHP Script from: http://localhost cucolin@ Linux - Software 3 01-30-2007 03:58 PM
Adding users with PHP (pass php variables to Expect script) Jayla Programming 1 10-20-2006 10:44 AM
php5 apache2 mysql4 don't work, php does not seem to read php.ini atom Linux - Software 5 03-24-2005 11:05 AM
php apache or php cgi - php learner rblampain Linux - Security 3 12-17-2004 11:10 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration