FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Help with PHP BD imaging functionality
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Help with PHP BD imaging functionality [message #182487 is a reply to message #182486] Thu, 08 August 2013 12:01 Go to previous messageGo to previous message
Ed Jay is currently offline  Ed Jay
Messages: 7
Registered: August 2013
Karma:
Junior Member
The Natural Philosopher wrote:

> On 08/08/13 00:53, Ed Jay wrote:
>> I'm trying to highlight a portion of a grayscale image, with the
>> highlighting color applied to pixels within a range of level only. I'm not
>> getting the result I seek.
>>
>> While the grayscale values within the range possibly yield the highlight
>> color, the entire image is masked with the color from the last
>> imagecolorallocate.
>>
>> My code follows, and the 'Process of interest' is the offending culprit.
>>
>> How do I highlight the value-region of interest with the background of my
>> choosing?
>
> is the problem less that you don't know how to make GD do what you want,
> then you don't actually know how to do what you want at all?

A massive sprinkling of each...
>
> Is what you want covered by this?

I already considered it a possibility, but it intuitively didn't strike me
as the best method available. Is it the only method available to
accomplish my goal?
>
> http://www.php.net/manual/en/image.examples.merged-watermark.php
>
>> //Process of interest:
>>
>> for($x=0; $x<$width; $x++){
>> for($y=0; $y<$height; $y++){
>>
>> $gray =(imagecolorat($final,$x,$y) >> 16) & 0xFF;
>> if (($gray > $gray_threshold) && ($gray < $gray_top)) {$gray =
>> $highlight_color;}
>> $gray2 = imagecolorallocate($final,$gray,$gray,$gray);
>> imagesetpixel($final, $x,$y,$gray2);
>>
>> }
>> }
>>

--
Ed Jay (remove 'M' to reply by email)

Win the War Against Breast Cancer.
Knowing the facts could save your life.
http://www.breastthermography.info
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: GUI designer in html
Next Topic: Dictionary Words
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Sep 18 13:17:29 GMT 2024

Total time taken to generate the page: 0.08478 seconds