php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22404 imageCopyMergeGray does not work
Submitted: 2003-02-24 16:41 UTC Modified: 2003-02-25 20:07 UTC
From: arebroff at rogers dot com Assigned:
Status: Not a bug Package: GD related
PHP Version: 4.3.1 OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: arebroff at rogers dot com
New email:
PHP Version: OS:

 

 [2003-02-24 16:41 UTC] arebroff at rogers dot com
This code outputs picture but it is not in grey palette and it does not depend on $transition.
Why?
How do  I need transform it to get image in black-and-white?
-----------------
$old=@imagecreatefromjpeg("userspictures/2.jpg");
$transition=0;
imageCopyMergeGray($old, $old, 0, 0, 100, 200, 300, 400, $transition);
Header("Content-type: image/jpeg"); 
Imagejpeg($old, '', 80);
-----------------

Thanks for any help.

Alexei

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-25 17:55 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The code does not work as expected due to the fact that both source & destination images are the same. This function will not work unless you are working with 2 seperate images (different content). When that is the case the function appears to work correctly.
 [2003-02-25 20:07 UTC] arebroff at rogers dot com
I changed my code but new one does not work at all!
I have to mention that imageCopyMerge vs imageCopyMergeGray works good in same function.
-----------------------------
$old=imagecreatefromjpeg("userspictures/2.jpg");
$new=imagecreatefromjpeg("userspictures/3.jpg");

imageCopyMergeGray($new, $old, 0, 0, 50, 50, 50, 50, 100);

Header("Content-type: image/jpeg"); 
Imagejpeg($new);
-----------------------------
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 05:01:33 2025 UTC