RE: [PHP] How to add a new color to JPEG

2001-07-10 Thread Jeff Lewis

Could try this:

$blue = ImageColorAllocate($image, 0, 0, 255);

Substitue blue for yellow and you'll be the appropriate RGB values for the
numbers.

Jeff

> -Original Message-
> From: SED [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 10, 2001 1:27 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] How to add a new color to JPEG
>
>
> Lets say I have a black JPEG-image and I want to add yellow text to it,
> how can I define the yellow color?
>
> According to the manual, you can only get closest value of your desired
> color by letting the ImageColorClosest() find it. Therefore, if the
> image is totally black, you can not get the yellow color. I have not
> found a way to do this though I believe I have tried everything. And
> yet, I have not found any documents covering this other than PHP-manual.
>
> Do you know of a way to do this? Or do you know of other
> manuals/tutorials covering this issue?
>
> Regards,
> Sumarlidi Einar Dadason
>
> SED - Graphic Design
>
> --
> Phone:   (+354) 4615501
> Mobile:  (+354) 8960376
> Fax: (+354) 4615503
> E-mail:  [EMAIL PROTECTED]
> Homepage:www.sed.is
> --
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to add a new color to JPEG

2001-07-10 Thread SED

That’s the problem, if I do that and the color is not used before in the
image, I get only the closest match. Note, if I add a yellow pixle into
the JPEG-image with Photoshop, save it and try it again, then I can use
the yellow for my text. However, I don’t want to have the yellow dot in
my picture, only a yellow text.

SED

-Original Message-
From: Jeff Lewis [mailto:[EMAIL PROTECTED]] 
Sent: 10. júlí 2001 17:26
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] How to add a new color to JPEG


Could try this:

$blue = ImageColorAllocate($image, 0, 0, 255);

Substitue blue for yellow and you'll be the appropriate RGB values for
the numbers.

Jeff

> -Original Message-
> From: SED [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 10, 2001 1:27 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] How to add a new color to JPEG
>
>
> Lets say I have a black JPEG-image and I want to add yellow text to 
> it, how can I define the yellow color?
>
> According to the manual, you can only get closest value of your 
> desired color by letting the ImageColorClosest() find it. Therefore, 
> if the image is totally black, you can not get the yellow color. I 
> have not found a way to do this though I believe I have tried 
> everything. And yet, I have not found any documents covering this 
> other than PHP-manual.
>
> Do you know of a way to do this? Or do you know of other 
> manuals/tutorials covering this issue?
>
> Regards,
> Sumarlidi Einar Dadason
>
> SED - Graphic Design
>
> --
> Phone:   (+354) 4615501
> Mobile:  (+354) 8960376
> Fax: (+354) 4615503
> E-mail:  [EMAIL PROTECTED]
> Homepage:www.sed.is
> --
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED] To 
> contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to add a new color to JPEG

2001-07-10 Thread Jeff Lewis

Hmm, I create my image from scratch and haven't tried drawing on an existing
pallette.  If your start image is always a blank black box you could always
create it on the fly...

> -Original Message-
> From: SED [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 10, 2001 1:52 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [PHP] How to add a new color to JPEG
>
>
> That’s the problem, if I do that and the color is not used before in the
> image, I get only the closest match. Note, if I add a yellow pixle into
> the JPEG-image with Photoshop, save it and try it again, then I can use
> the yellow for my text. However, I don’t want to have the yellow dot in
> my picture, only a yellow text.
>
> SED
>
> -Original Message-
> From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> Sent: 10. júlí 2001 17:26
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [PHP] How to add a new color to JPEG
>
>
> Could try this:
>
> $blue = ImageColorAllocate($image, 0, 0, 255);
>
> Substitue blue for yellow and you'll be the appropriate RGB values for
> the numbers.
>
> Jeff
>
> > -Original Message-
> > From: SED [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, July 10, 2001 1:27 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] How to add a new color to JPEG
> >
> >
> > Lets say I have a black JPEG-image and I want to add yellow text to
> > it, how can I define the yellow color?
> >
> > According to the manual, you can only get closest value of your
> > desired color by letting the ImageColorClosest() find it. Therefore,
> > if the image is totally black, you can not get the yellow color. I
> > have not found a way to do this though I believe I have tried
> > everything. And yet, I have not found any documents covering this
> > other than PHP-manual.
> >
> > Do you know of a way to do this? Or do you know of other
> > manuals/tutorials covering this issue?
> >
> > Regards,
> > Sumarlidi Einar Dadason
> >
> > SED - Graphic Design
> >
> > --
> > Phone:   (+354) 4615501
> > Mobile:  (+354) 8960376
> > Fax: (+354) 4615503
> > E-mail:  [EMAIL PROTECTED]
> > Homepage:www.sed.is
> > --
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED] To
> > contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to add a new color to JPEG

2001-07-10 Thread James Cox


hmm.

If what I understand from your ImageColorClosest(); function, why don't you
just add yellow to the palette? that way it can be found by the function,
but isn't used in the image?

HTH,

James Cox

apologies jeff for sending it twice to you :)

> -Original Message-
> From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> Sent: 10 July 2001 23:00
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [PHP] How to add a new color to JPEG
>
>
> Hmm, I create my image from scratch and haven't tried drawing on
> an existing
> pallette.  If your start image is always a blank black box you
> could always
> create it on the fly...
>
> > -Original Message-
> > From: SED [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, July 10, 2001 1:52 PM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: RE: [PHP] How to add a new color to JPEG
> >
> >
> > That’s the problem, if I do that and the color is not used before in the
> > image, I get only the closest match. Note, if I add a yellow pixle into
> > the JPEG-image with Photoshop, save it and try it again, then I can use
> > the yellow for my text. However, I don’t want to have the yellow dot in
> > my picture, only a yellow text.
> >
> > SED
> >
> > -Original Message-----
> > From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> > Sent: 10. júlí 2001 17:26
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: RE: [PHP] How to add a new color to JPEG
> >
> >
> > Could try this:
> >
> > $blue = ImageColorAllocate($image, 0, 0, 255);
> >
> > Substitue blue for yellow and you'll be the appropriate RGB values for
> > the numbers.
> >
> > Jeff
> >
> > > -Original Message-
> > > From: SED [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, July 10, 2001 1:27 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] How to add a new color to JPEG
> > >
> > >
> > > Lets say I have a black JPEG-image and I want to add yellow text to
> > > it, how can I define the yellow color?
> > >
> > > According to the manual, you can only get closest value of your
> > > desired color by letting the ImageColorClosest() find it. Therefore,
> > > if the image is totally black, you can not get the yellow color. I
> > > have not found a way to do this though I believe I have tried
> > > everything. And yet, I have not found any documents covering this
> > > other than PHP-manual.
> > >
> > > Do you know of a way to do this? Or do you know of other
> > > manuals/tutorials covering this issue?
> > >
> > > Regards,
> > > Sumarlidi Einar Dadason
> > >
> > > SED - Graphic Design
> > >
> > > --
> > > Phone:   (+354) 4615501
> > > Mobile:  (+354) 8960376
> > > Fax: (+354) 4615503
> > > E-mail:  [EMAIL PROTECTED]
> > > Homepage:www.sed.is
> > > --
> > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED] To
> > > contact the list administrators, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to add a new color to JPEG

2001-07-10 Thread SED

How can I add colors to JPEG-palette? I never new It had a special
palette (until now :).

-Original Message-
From: James Cox [mailto:[EMAIL PROTECTED]] 
Sent: 10. júlí 2001 22:38
To: Jeff@Hyrum. Net
Cc: [EMAIL PROTECTED]; Php-General@Lists. Php. Net
Subject: RE: [PHP] How to add a new color to JPEG



hmm.

If what I understand from your ImageColorClosest(); function, why don't
you just add yellow to the palette? that way it can be found by the
function, but isn't used in the image?

HTH,

James Cox

apologies jeff for sending it twice to you :)

> -Original Message-
> From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> Sent: 10 July 2001 23:00
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [PHP] How to add a new color to JPEG
>
>
> Hmm, I create my image from scratch and haven't tried drawing on an 
> existing pallette.  If your start image is always a blank black box 
> you could always
> create it on the fly...
>
> > -Original Message-
> > From: SED [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, July 10, 2001 1:52 PM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: RE: [PHP] How to add a new color to JPEG
> >
> >
> > That’s the problem, if I do that and the color is not used before in

> > the image, I get only the closest match. Note, if I add a yellow 
> > pixle into the JPEG-image with Photoshop, save it and try it again, 
> > then I can use the yellow for my text. However, I don’t want to have

> > the yellow dot in my picture, only a yellow text.
> >
> > SED
> >
> > -Original Message-----
> > From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> > Sent: 10. júlí 2001 17:26
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: RE: [PHP] How to add a new color to JPEG
> >
> >
> > Could try this:
> >
> > $blue = ImageColorAllocate($image, 0, 0, 255);
> >
> > Substitue blue for yellow and you'll be the appropriate RGB values 
> > for the numbers.
> >
> > Jeff
> >
> > > -Original Message-
> > > From: SED [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, July 10, 2001 1:27 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] How to add a new color to JPEG
> > >
> > >
> > > Lets say I have a black JPEG-image and I want to add yellow text 
> > > to it, how can I define the yellow color?
> > >
> > > According to the manual, you can only get closest value of your 
> > > desired color by letting the ImageColorClosest() find it. 
> > > Therefore, if the image is totally black, you can not get the 
> > > yellow color. I have not found a way to do this though I believe I

> > > have tried everything. And yet, I have not found any documents 
> > > covering this other than PHP-manual.
> > >
> > > Do you know of a way to do this? Or do you know of other 
> > > manuals/tutorials covering this issue?
> > >
> > > Regards,
> > > Sumarlidi Einar Dadason
> > >
> > > SED - Graphic Design
> > >
> > > --
> > > Phone:   (+354) 4615501
> > > Mobile:  (+354) 8960376
> > > Fax: (+354) 4615503
> > > E-mail:  [EMAIL PROTECTED]
> > > Homepage:www.sed.is
> > > --
> > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED] To

> > > contact the list administrators, e-mail: 
> > > [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED] To 
> > contact the list administrators, e-mail: 
> > [EMAIL PROTECTED]
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED] To 
> contact the list administrators, e-mail: [EMAIL PROTECTED]
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to add a new color to JPEG

2001-07-10 Thread James Cox

That's something you would need to do in photoshop.

open your image, select save for web, look to the left of the image, you
should see some buttons and a black box. you need to click on the black box,
select the yellow you want, and then click ok. Then, click the button above
the yellow - that will select the eyedropper. Then, go to the color palette
opposite. click on the 3rd icon underneath it, which allows you to add
eyedropper color to the palette.

That should work. mail me if you get stuck, with your image dimensions/copy
of image.

James

> -Original Message-
> From: SED [mailto:[EMAIL PROTECTED]]
> Sent: 11 July 2001 00:21
> To: 'James Cox'; [EMAIL PROTECTED]
> Subject: RE: [PHP] How to add a new color to JPEG
>
>
> How can I add colors to JPEG-palette? I never new It had a special
> palette (until now :).
>
> -Original Message-
> From: James Cox [mailto:[EMAIL PROTECTED]]
> Sent: 10. júlí 2001 22:38
> To: Jeff@Hyrum. Net
> Cc: [EMAIL PROTECTED]; Php-General@Lists. Php. Net
> Subject: RE: [PHP] How to add a new color to JPEG
>
>
>
> hmm.
>
> If what I understand from your ImageColorClosest(); function, why don't
> you just add yellow to the palette? that way it can be found by the
> function, but isn't used in the image?
>
> HTH,
>
> James Cox
>
> apologies jeff for sending it twice to you :)
>
> > -Original Message-
> > From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> > Sent: 10 July 2001 23:00
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: RE: [PHP] How to add a new color to JPEG
> >
> >
> > Hmm, I create my image from scratch and haven't tried drawing on an
> > existing pallette.  If your start image is always a blank black box
> > you could always
> > create it on the fly...
> >
> > > -----Original Message-
> > > From: SED [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, July 10, 2001 1:52 PM
> > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: RE: [PHP] How to add a new color to JPEG
> > >
> > >
> > > That’s the problem, if I do that and the color is not used before in
>
> > > the image, I get only the closest match. Note, if I add a yellow
> > > pixle into the JPEG-image with Photoshop, save it and try it again,
> > > then I can use the yellow for my text. However, I don’t want to have
>
> > > the yellow dot in my picture, only a yellow text.
> > >
> > > SED
> > >
> > > -Original Message-
> > > From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> > > Sent: 10. júlí 2001 17:26
> > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: RE: [PHP] How to add a new color to JPEG
> > >
> > >
> > > Could try this:
> > >
> > > $blue = ImageColorAllocate($image, 0, 0, 255);
> > >
> > > Substitue blue for yellow and you'll be the appropriate RGB values
> > > for the numbers.
> > >
> > > Jeff
> > >
> > > > -Original Message-
> > > > From: SED [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, July 10, 2001 1:27 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP] How to add a new color to JPEG
> > > >
> > > >
> > > > Lets say I have a black JPEG-image and I want to add yellow text
> > > > to it, how can I define the yellow color?
> > > >
> > > > According to the manual, you can only get closest value of your
> > > > desired color by letting the ImageColorClosest() find it.
> > > > Therefore, if the image is totally black, you can not get the
> > > > yellow color. I have not found a way to do this though I believe I
>
> > > > have tried everything. And yet, I have not found any documents
> > > > covering this other than PHP-manual.
> > > >
> > > > Do you know of a way to do this? Or do you know of other
> > > > manuals/tutorials covering this issue?
> > > >
> > > > Regards,
> > > > Sumarlidi Einar Dadason
> > > >
> > > > SED - Graphic Design
> > > >
> > > > --
> > > > Phone:   (+354) 4615501
> > > > Mobile:  (+354) 8960376
> > > > Fax: (+354) 4615503
> > > > E-mail:  [EMAIL PROTECTED]
> > > > Homepage:www.sed.is
> > > > --
> > > >
> > > >
> > > >
&g

RE: [PHP] How to add a new color to JPEG

2001-07-10 Thread Matthew Loff


Is this only a problem with PHP/GD versions previous to 4.0.6/2.0.1?

Does the new ImageCreateTrueColor() function fix this issue?

http://www.php.net/manual/en/function.imagecreatetruecolor.php



-Original Message-
From: James Cox [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 10, 2001 7:28 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] How to add a new color to JPEG


That's something you would need to do in photoshop.

open your image, select save for web, look to the left of the image, you
should see some buttons and a black box. you need to click on the black
box, select the yellow you want, and then click ok. Then, click the
button above the yellow - that will select the eyedropper. Then, go to
the color palette opposite. click on the 3rd icon underneath it, which
allows you to add eyedropper color to the palette.

That should work. mail me if you get stuck, with your image
dimensions/copy of image.

James

> -Original Message-
> From: SED [mailto:[EMAIL PROTECTED]]
> Sent: 11 July 2001 00:21
> To: 'James Cox'; [EMAIL PROTECTED]
> Subject: RE: [PHP] How to add a new color to JPEG
>
>
> How can I add colors to JPEG-palette? I never new It had a special 
> palette (until now :).
>
> -Original Message-
> From: James Cox [mailto:[EMAIL PROTECTED]]
> Sent: 10. júlí 2001 22:38
> To: Jeff@Hyrum. Net
> Cc: [EMAIL PROTECTED]; Php-General@Lists. Php. Net
> Subject: RE: [PHP] How to add a new color to JPEG
>
>
>
> hmm.
>
> If what I understand from your ImageColorClosest(); function, why 
> don't you just add yellow to the palette? that way it can be found by 
> the function, but isn't used in the image?
>
> HTH,
>
> James Cox
>
> apologies jeff for sending it twice to you :)
>
> > -Original Message-
> > From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> > Sent: 10 July 2001 23:00
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: RE: [PHP] How to add a new color to JPEG
> >
> >
> > Hmm, I create my image from scratch and haven't tried drawing on an 
> > existing pallette.  If your start image is always a blank black box 
> > you could always create it on the fly...
> >
> > > -----Original Message-
> > > From: SED [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, July 10, 2001 1:52 PM
> > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: RE: [PHP] How to add a new color to JPEG
> > >
> > >
> > > That’s the problem, if I do that and the color is not used before 
> > > in
>
> > > the image, I get only the closest match. Note, if I add a yellow 
> > > pixle into the JPEG-image with Photoshop, save it and try it 
> > > again, then I can use the yellow for my text. However, I don’t 
> > > want to have
>
> > > the yellow dot in my picture, only a yellow text.
> > >
> > > SED
> > >
> > > -Original Message-
> > > From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> > > Sent: 10. júlí 2001 17:26
> > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: RE: [PHP] How to add a new color to JPEG
> > >
> > >
> > > Could try this:
> > >
> > > $blue = ImageColorAllocate($image, 0, 0, 255);
> > >
> > > Substitue blue for yellow and you'll be the appropriate RGB values

> > > for the numbers.
> > >
> > > Jeff
> > >
> > > > -Original Message-
> > > > From: SED [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, July 10, 2001 1:27 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP] How to add a new color to JPEG
> > > >
> > > >
> > > > Lets say I have a black JPEG-image and I want to add yellow text

> > > > to it, how can I define the yellow color?
> > > >
> > > > According to the manual, you can only get closest value of your 
> > > > desired color by letting the ImageColorClosest() find it. 
> > > > Therefore, if the image is totally black, you can not get the 
> > > > yellow color. I have not found a way to do this though I believe

> > > > I
>
> > > > have tried everything. And yet, I have not found any documents 
> > > > covering this other than PHP-manual.
> > > >
> > > > Do you know of a way to do this? Or do you know of other 
> > > > manuals/tutorials covering this issue?
> > > >
> > > > Regards,
> > > > Sumarlidi Einar Dadason
> > > >
> > > > SED - 

RE: [PHP] How to add a new color to JPEG

2001-07-10 Thread SED

I'm not sure I follow. I know this is how I would do it if I had a
GIF-image, but this does not include JPEG. That’s the main issue. The
JPEG is saved as an RGB-image, not index colored like GIF, therefore I'm
asking about how to add a RGB color to a non-index-color-image (JPEG).
Are you sure you are talking about JPEG, not GIF?

SED

-Original Message-
From: James Cox [mailto:[EMAIL PROTECTED]] 
Sent: 10. júlí 2001 23:28
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] How to add a new color to JPEG


That's something you would need to do in photoshop.

open your image, select save for web, look to the left of the image, you
should see some buttons and a black box. you need to click on the black
box, select the yellow you want, and then click ok. Then, click the
button above the yellow - that will select the eyedropper. Then, go to
the color palette opposite. click on the 3rd icon underneath it, which
allows you to add eyedropper color to the palette.

That should work. mail me if you get stuck, with your image
dimensions/copy of image.

James

> -Original Message-
> From: SED [mailto:[EMAIL PROTECTED]]
> Sent: 11 July 2001 00:21
> To: 'James Cox'; [EMAIL PROTECTED]
> Subject: RE: [PHP] How to add a new color to JPEG
>
>
> How can I add colors to JPEG-palette? I never new It had a special 
> palette (until now :).
>
> -Original Message-
> From: James Cox [mailto:[EMAIL PROTECTED]]
> Sent: 10. júlí 2001 22:38
> To: Jeff@Hyrum. Net
> Cc: [EMAIL PROTECTED]; Php-General@Lists. Php. Net
> Subject: RE: [PHP] How to add a new color to JPEG
>
>
>
> hmm.
>
> If what I understand from your ImageColorClosest(); function, why 
> don't you just add yellow to the palette? that way it can be found by 
> the function, but isn't used in the image?
>
> HTH,
>
> James Cox
>
> apologies jeff for sending it twice to you :)
>
> > -Original Message-
> > From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> > Sent: 10 July 2001 23:00
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: RE: [PHP] How to add a new color to JPEG
> >
> >
> > Hmm, I create my image from scratch and haven't tried drawing on an 
> > existing pallette.  If your start image is always a blank black box 
> > you could always create it on the fly...
> >
> > > -----Original Message-
> > > From: SED [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, July 10, 2001 1:52 PM
> > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: RE: [PHP] How to add a new color to JPEG
> > >
> > >
> > > That’s the problem, if I do that and the color is not used before 
> > > in
>
> > > the image, I get only the closest match. Note, if I add a yellow 
> > > pixle into the JPEG-image with Photoshop, save it and try it 
> > > again, then I can use the yellow for my text. However, I don’t 
> > > want to have
>
> > > the yellow dot in my picture, only a yellow text.
> > >
> > > SED
> > >
> > > -Original Message-
> > > From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> > > Sent: 10. júlí 2001 17:26
> > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: RE: [PHP] How to add a new color to JPEG
> > >
> > >
> > > Could try this:
> > >
> > > $blue = ImageColorAllocate($image, 0, 0, 255);
> > >
> > > Substitue blue for yellow and you'll be the appropriate RGB values

> > > for the numbers.
> > >
> > > Jeff
> > >
> > > > -Original Message-
> > > > From: SED [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, July 10, 2001 1:27 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP] How to add a new color to JPEG
> > > >
> > > >
> > > > Lets say I have a black JPEG-image and I want to add yellow text

> > > > to it, how can I define the yellow color?
> > > >
> > > > According to the manual, you can only get closest value of your 
> > > > desired color by letting the ImageColorClosest() find it. 
> > > > Therefore, if the image is totally black, you can not get the 
> > > > yellow color. I have not found a way to do this though I believe

> > > > I
>
> > > > have tried everything. And yet, I have not found any documents 
> > > > covering this other than PHP-manual.
> > > >
> > > > Do you know of a way to do this? Or do you know of other 
> > > > manuals/tutorials covering this issue?
> >

RE: [PHP] How to add a new color to JPEG

2001-07-10 Thread SED

I have version 4.0.5 so I need to upgrade :)

However, I found work around on the PHP-website:

--
I experienced the same, but i use following workaround: 
Create a new Jpeg, Allocate your colours, and copy your original jpg
into the new one. then you have all the colours you have allocated in
your new pic...

I experienced the same, but i use following workaround: 
Create a new Jpeg, Allocate your colours, and copy your original jpg
into the new one. then you have all the colours you have allocated in
your new pic...
--

So this problem is solved. Thank you for the help.

SED



-Original Message-
From: Matthew Loff [mailto:[EMAIL PROTECTED]] 
Sent: 10. júlí 2001 23:30
To: 'James Cox'; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] How to add a new color to JPEG



Is this only a problem with PHP/GD versions previous to 4.0.6/2.0.1?

Does the new ImageCreateTrueColor() function fix this issue?

http://www.php.net/manual/en/function.imagecreatetruecolor.php



-Original Message-
From: James Cox [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 10, 2001 7:28 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] How to add a new color to JPEG


That's something you would need to do in photoshop.

open your image, select save for web, look to the left of the image, you
should see some buttons and a black box. you need to click on the black
box, select the yellow you want, and then click ok. Then, click the
button above the yellow - that will select the eyedropper. Then, go to
the color palette opposite. click on the 3rd icon underneath it, which
allows you to add eyedropper color to the palette.

That should work. mail me if you get stuck, with your image
dimensions/copy of image.

James

> -Original Message-
> From: SED [mailto:[EMAIL PROTECTED]]
> Sent: 11 July 2001 00:21
> To: 'James Cox'; [EMAIL PROTECTED]
> Subject: RE: [PHP] How to add a new color to JPEG
>
>
> How can I add colors to JPEG-palette? I never new It had a special
> palette (until now :).
>
> -Original Message-
> From: James Cox [mailto:[EMAIL PROTECTED]]
> Sent: 10. júlí 2001 22:38
> To: Jeff@Hyrum. Net
> Cc: [EMAIL PROTECTED]; Php-General@Lists. Php. Net
> Subject: RE: [PHP] How to add a new color to JPEG
>
>
>
> hmm.
>
> If what I understand from your ImageColorClosest(); function, why
> don't you just add yellow to the palette? that way it can be found by 
> the function, but isn't used in the image?
>
> HTH,
>
> James Cox
>
> apologies jeff for sending it twice to you :)
>
> > -Original Message-
> > From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> > Sent: 10 July 2001 23:00
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: RE: [PHP] How to add a new color to JPEG
> >
> >
> > Hmm, I create my image from scratch and haven't tried drawing on an
> > existing pallette.  If your start image is always a blank black box 
> > you could always create it on the fly...
> >
> > > -----Original Message-
> > > From: SED [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, July 10, 2001 1:52 PM
> > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: RE: [PHP] How to add a new color to JPEG
> > >
> > >
> > > That’s the problem, if I do that and the color is not used before
> > > in
>
> > > the image, I get only the closest match. Note, if I add a yellow
> > > pixle into the JPEG-image with Photoshop, save it and try it 
> > > again, then I can use the yellow for my text. However, I don’t 
> > > want to have
>
> > > the yellow dot in my picture, only a yellow text.
> > >
> > > SED
> > >
> > > -Original Message-
> > > From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> > > Sent: 10. júlí 2001 17:26
> > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: RE: [PHP] How to add a new color to JPEG
> > >
> > >
> > > Could try this:
> > >
> > > $blue = ImageColorAllocate($image, 0, 0, 255);
> > >
> > > Substitue blue for yellow and you'll be the appropriate RGB values

> > > for the numbers.
> > >
> > > Jeff
> > >
> > > > -Original Message-
> > > > From: SED [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, July 10, 2001 1:27 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP] How to add a new color to JPEG
> > > >
> > > >
> > > > Lets say I have a black JPEG-image and I want to add yellow text

> > > > to it, how can I define the yellow color?
&

RE: [PHP] How to add a new color to JPEG

2001-07-10 Thread Matthew Loff


I believe the problem is GD previous to version 2.0.1... They could only
create images with indexed (256?) colors...

I had a PHP script that used GD to resize JPEGs to smaller thumbnails
automatically... And it would always reduce them to 256 colors, until I
upgraded to PHP 4.0.6, GD 2.0.1, and used ImageCreateTrueColor()

--Matt


-Original Message-
From: SED [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 10, 2001 9:17 PM
To: 'James Cox'; [EMAIL PROTECTED]
Subject: RE: [PHP] How to add a new color to JPEG


I'm not sure I follow. I know this is how I would do it if I had a
GIF-image, but this does not include JPEG. That’s the main issue. The
JPEG is saved as an RGB-image, not index colored like GIF, therefore I'm
asking about how to add a RGB color to a non-index-color-image (JPEG).
Are you sure you are talking about JPEG, not GIF?

SED

-Original Message-
From: James Cox [mailto:[EMAIL PROTECTED]] 
Sent: 10. júlí 2001 23:28
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] How to add a new color to JPEG


That's something you would need to do in photoshop.

open your image, select save for web, look to the left of the image, you
should see some buttons and a black box. you need to click on the black
box, select the yellow you want, and then click ok. Then, click the
button above the yellow - that will select the eyedropper. Then, go to
the color palette opposite. click on the 3rd icon underneath it, which
allows you to add eyedropper color to the palette.

That should work. mail me if you get stuck, with your image
dimensions/copy of image.

James

> -Original Message-
> From: SED [mailto:[EMAIL PROTECTED]]
> Sent: 11 July 2001 00:21
> To: 'James Cox'; [EMAIL PROTECTED]
> Subject: RE: [PHP] How to add a new color to JPEG
>
>
> How can I add colors to JPEG-palette? I never new It had a special
> palette (until now :).
>
> -Original Message-
> From: James Cox [mailto:[EMAIL PROTECTED]]
> Sent: 10. júlí 2001 22:38
> To: Jeff@Hyrum. Net
> Cc: [EMAIL PROTECTED]; Php-General@Lists. Php. Net
> Subject: RE: [PHP] How to add a new color to JPEG
>
>
>
> hmm.
>
> If what I understand from your ImageColorClosest(); function, why
> don't you just add yellow to the palette? that way it can be found by 
> the function, but isn't used in the image?
>
> HTH,
>
> James Cox
>
> apologies jeff for sending it twice to you :)
>
> > -Original Message-----
> > From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> > Sent: 10 July 2001 23:00
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: RE: [PHP] How to add a new color to JPEG
> >
> >
> > Hmm, I create my image from scratch and haven't tried drawing on an
> > existing pallette.  If your start image is always a blank black box 
> > you could always create it on the fly...
> >
> > > -Original Message-
> > > From: SED [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, July 10, 2001 1:52 PM
> > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: RE: [PHP] How to add a new color to JPEG
> > >
> > >
> > > That’s the problem, if I do that and the color is not used before
> > > in
>
> > > the image, I get only the closest match. Note, if I add a yellow
> > > pixle into the JPEG-image with Photoshop, save it and try it 
> > > again, then I can use the yellow for my text. However, I don’t 
> > > want to have
>
> > > the yellow dot in my picture, only a yellow text.
> > >
> > > SED
> > >
> > > -Original Message-
> > > From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> > > Sent: 10. júlí 2001 17:26
> > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: RE: [PHP] How to add a new color to JPEG
> > >
> > >
> > > Could try this:
> > >
> > > $blue = ImageColorAllocate($image, 0, 0, 255);
> > >
> > > Substitue blue for yellow and you'll be the appropriate RGB values

> > > for the numbers.
> > >
> > > Jeff
> > >
> > > > -Original Message-
> > > > From: SED [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, July 10, 2001 1:27 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP] How to add a new color to JPEG
> > > >
> > > >
> > > > Lets say I have a black JPEG-image and I want to add yellow text

> > > > to it, how can I define the yellow color?
> > > >
> > > > According to the manual, you can only get closest value of your
> > > > desired color by letting th

Re: [PHP] How to add a new color to JPEG

2001-07-17 Thread Jennifer

> > > -Original Message-
> > > From: SED [mailto:[EMAIL PROTECTED]]
> > > According to the manual, you can only get closest value of your
> > > desired color by letting the ImageColorClosest() find it. Therefore,
> > > if the image is totally black, you can not get the yellow color. I
> > > have not found a way to do this though I believe I have tried
> > > everything. And yet, I have not found any documents covering this
> > > other than PHP-manual.

I didn't get this from reading the manual, but I struggled with
this problem for days and finally gave up.  I posted to some
other forums when this one was done and found no answers.

Now, I know it isn't just me and I know what the problem is, but
I still don't know a solution.

I am creating an image on the fly and I have no problem if I am
just using a background color and adding text to it or if I use
ImageCreateFromPNG, but if I use ImageCreateFromJPEG and try to
add text on top of that or even a rectangle or anything on top,
it seems to ignore the color that I specify and always came out
grey. (Of course now if I use ImageColorClosest(), some colors
work because they are in my image.)

It doesn't matter what I output it as, only what I read it in as.

And if I read it in as a png, the image quality is horrible which
I also don't understand. It seems to have drastically reduced the
number of colors used.

My phphinfo says GD version 1.6.2 or higher I'm using PHP Version
4.0.1pl2

Here is my test page.
http://216.122.251.174/test/test.php

Here is the source for the graphic
http://216.122.251.174/test/button.phps

Any idea on how solutions?

Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to add a new color to JPEG

2001-07-17 Thread Jennifer



Jennifer wrote:
> it seems to ignore the color that I specify and always came out
> grey. (Of course now if I use ImageColorClosest(), some colors
> work because they are in my image.)
> 
> 
> Any idea on how solutions?
> 


Oops.  I didn't read far enough.  I found the following in a
separate thread.


> I experienced the same, but i use following workaround: 
> Create a new Jpeg, Allocate your colours, and copy your original jpg
> into the new one. then you have all the colours you have allocated in
> your new pic...

So now my question is, how do I copy one image into another?

I see ImageCopy(), but it mentions copying a part of the image,
so do I have to use GetImageSize to determine the size of the src
image first?

Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to add a new color to JPEG

2001-07-17 Thread Matthew Loff


I don't know a way around the problem you're describing with your
version of PHP, but PHP 4.0.6 with GD 2.0.1 allows you to call
ImageCreateTrueColor(), which eliminates the 256-color limitation with
JPEG files-- solved my problem right away.

-Original Message-
From: Jennifer [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 17, 2001 5:55 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] How to add a new color to JPEG


> > > -Original Message-
> > > From: SED [mailto:[EMAIL PROTECTED]]
> > > According to the manual, you can only get closest value of your 
> > > desired color by letting the ImageColorClosest() find it. 
> > > Therefore, if the image is totally black, you can not get the 
> > > yellow color. I have not found a way to do this though I believe I

> > > have tried everything. And yet, I have not found any documents 
> > > covering this other than PHP-manual.

I didn't get this from reading the manual, but I struggled with this
problem for days and finally gave up.  I posted to some other forums
when this one was done and found no answers.

Now, I know it isn't just me and I know what the problem is, but I still
don't know a solution.

I am creating an image on the fly and I have no problem if I am just
using a background color and adding text to it or if I use
ImageCreateFromPNG, but if I use ImageCreateFromJPEG and try to add text
on top of that or even a rectangle or anything on top, it seems to
ignore the color that I specify and always came out grey. (Of course now
if I use ImageColorClosest(), some colors work because they are in my
image.)

It doesn't matter what I output it as, only what I read it in as.

And if I read it in as a png, the image quality is horrible which I also
don't understand. It seems to have drastically reduced the number of
colors used.

My phphinfo says GD version 1.6.2 or higher I'm using PHP Version
4.0.1pl2

Here is my test page.
http://216.122.251.174/test/test.php

Here is the source for the graphic
http://216.122.251.174/test/button.phps

Any idea on how solutions?

Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to add a new color to JPEG

2001-07-17 Thread Jon Yaggie

has this problem

check the annoted manual on php.net.  i believe there is a work arround
posted on imagecolorallocate() and i reposted the same thing under
imagecreatefromjpeg.  basically you create and image, allocate colors, and
then copy your jpeg on it.





Thank You,

Jon Yaggie
www.design-monster.com

And they were singing . . .

'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code

101 little bugs in the code . . .'

And it continued until they reached 0


- Original Message -
From: "Matthew Loff" <[EMAIL PROTECTED]>
To: "'Jennifer'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 12:01 AM
Subject: RE: [PHP] How to add a new color to JPEG


>
> I don't know a way around the problem you're describing with your
> version of PHP, but PHP 4.0.6 with GD 2.0.1 allows you to call
> ImageCreateTrueColor(), which eliminates the 256-color limitation with
> JPEG files-- solved my problem right away.
>
> -Original Message-
> From: Jennifer [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 17, 2001 5:55 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] How to add a new color to JPEG
>
>
> > > > -Original Message-
> > > > From: SED [mailto:[EMAIL PROTECTED]]
> > > > According to the manual, you can only get closest value of your
> > > > desired color by letting the ImageColorClosest() find it.
> > > > Therefore, if the image is totally black, you can not get the
> > > > yellow color. I have not found a way to do this though I believe I
>
> > > > have tried everything. And yet, I have not found any documents
> > > > covering this other than PHP-manual.
>
> I didn't get this from reading the manual, but I struggled with this
> problem for days and finally gave up.  I posted to some other forums
> when this one was done and found no answers.
>
> Now, I know it isn't just me and I know what the problem is, but I still
> don't know a solution.
>
> I am creating an image on the fly and I have no problem if I am just
> using a background color and adding text to it or if I use
> ImageCreateFromPNG, but if I use ImageCreateFromJPEG and try to add text
> on top of that or even a rectangle or anything on top, it seems to
> ignore the color that I specify and always came out grey. (Of course now
> if I use ImageColorClosest(), some colors work because they are in my
> image.)
>
> It doesn't matter what I output it as, only what I read it in as.
>
> And if I read it in as a png, the image quality is horrible which I also
> don't understand. It seems to have drastically reduced the number of
> colors used.
>
> My phphinfo says GD version 1.6.2 or higher I'm using PHP Version
> 4.0.1pl2
>
> Here is my test page.
> http://216.122.251.174/test/test.php
>
> Here is the source for the graphic
> http://216.122.251.174/test/button.phps
>
> Any idea on how solutions?
>
> Jennifer
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED] To
> contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]