Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126193 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id D38F91A00ED for ; Tue, 31 Dec 2024 16:47:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1735663443; bh=d2OdzKqRT2HKmn1gE9vIKrHQu/rSra+xMnwH/0+Xm5Y=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=I3hxJ3NwMcxYiv/7naK2yDdHhzGbeG+YPIawHsgOqW9NsnuTJtiH/WLsJtXUGg84S xhJawyrrrd+4QC65I1cpiPIJwl9d/hwn7r1EdhkZYg3xqqqXj/sJIv36JIeaqr9kpL TGXyts6cbu8U+xz7QRQeC89WKwXM4DgfH1X8/AIAm+HUwEeEN0G7AwSOKgUNEggzbo 1tMdWVsuOxsnMqjYfafJa7VqyMPLXqm6H+xzhVLtENJfP46nM8gEpECkoouCy/d6jj If7g1HEvOKRrUSCtQNuXaHhdNEM4ZlRs7gJU1hmbzSOjnVHil1p5twslHTw2EmhwfM EFQRvoZFoqWhw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A9930180080 for ; Tue, 31 Dec 2024 16:44:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 31 Dec 2024 16:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1735663615; x=1736268415; i=cmbecker69@gmx.de; bh=iyKx60cevJdd29aiUrjZNkXMaW2f7mbk2VKjisHi9wc=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=fOsuWbA1WFA5z5NcHyYmF4Wilp/5q4oGMUyPpE8K4CCxByyDHoeYsACOR6RNepA4 OjppZnbex2tY5eFLvOXvlz+kF7+Zle+/a0aaz4iTHVg0UMJz7mV03nF7KfijE0iPm S8ToLl+XKyTooYL7H+aZc1ldfQTwm/KoG0gJX7Alv3PEf1mzGtcW4FPMNkhbzFWEW 76xph3PPVcKSHnrN/Y+SA7+yQ47H3GWH25zZbtwKQxfuYSJbZdy69y1c1z/z2Y+ZO z/z9SuF0zAF09cracc7El1n1LDuu2DUbeBYmnkoPLYLjcbvg29c4LWJnzr+UYTWwN D5T+blaOHb06oNM71g== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.2.130] ([79.251.201.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N1OXT-1teicX3gM7-013g2n; Tue, 31 Dec 2024 17:46:54 +0100 Message-ID: <3cd871ef-1983-4cd7-a045-9b4e6e4c2387@gmx.de> Date: Tue, 31 Dec 2024 17:46:53 +0100 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] ext/gd new imagematch function (was: adding imagecompare) Content-Language: de-DE To: Giovanni Giacobbi Cc: PHP Internals List References: <631837de-c2a0-4bde-9400-5e8e5f2a0906@gmx.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:HHIo4ryrLlJjFRFkSRcQe0PM6MZLoQ+IkDu2rEISShBdcfNIBT1 UXWUnPgDtnvGT5H2bO/jQjsOE6hQGebuuKV28RC9HCTuEfRe5eelSUVwgyM/6X+0Zk2fM7G Ah0KA2dnGMXS1OKyzOZDoU74ysCH6eLLqjt+cI6ixzu8ohSE08cp4G7fr9u+URWHKlCuxS1 f9nC3WugCED5bfl4PvRtQ== UI-OutboundReport: notjunk:1;M01:P0:hGMlQg/8GJY=;gZ0hsVmaNSG99/pzQGtwVMFhZ5d YCBxoIuK1fovY85nsSq5g6U78Tb93DmUliju1LT7EqCOZ/SQmacbu7+YuujAXrKAtaD7EUPjo 965jUfqAB6ajHEPclljdyGvn/VKk5sVUMeS66SlKFvL6ND4cSoYoozw/Q7oxuwlMTBSYUi7p5 kxb24ozOLtQU+dCcyR2fUkzn+w3Hd1yFspYTTrSgeGg8NvuKPYHvXLlkyAvYzA2qKARacQTig unzoIIb45In7wLoEdxLEq4Py0y6gCK/tCIhUNAZQ6HftTpIqVIyvizMxU8yXCEbw48/otx4eZ ov/YjbHwy+Xgc3YgDAHnH7Epzbm3ewtN9cjkpPbb8N1jWubLRlge4aw1NyqCbHcp92c6Fsvg1 qOzkJdooIOlQu1FzlSUGJV8m2d4MKV/r9bYN4NbgmRumofSN4Bky765CwvKV2AXGR64B9BvB7 xNMXmyKfKNSdM+Eq6NbY+8j1sIgscFTQEDsu1XtVGr3jPgkwHqfyXsDdXbvUx1OqK5lalTpDJ wr9QmPS6dAc8L+wcYiSWihqfs2U8QwgNEXpj2DxkcEG16pxNdw4A7/uS5fNk9czpqZCFRGdMu XW/haFCOU+7Tvr/LmATE9DkD9I4qfPSXD3wOL4obYnUpx5KQnRnjb/JVk/qDtxAOMxjVzAXfO m2+6JNiRI5u7L+cC10pT3aWBA42KGoGnUydFwt+5qlFUR1j3JV6lBqbs0xHcBY/5ZRNWS/LyD jIy3SxqRiX7RDZ5kl78+xDFyjjMBHmq58w4iU+Zsa6nars6NQ+uXaQZX/S1ACwRwS0V5RHQZP irXc3z6J/9jAAnXnU9I66aOzllgzL7AAvlapWt0ze7icZtHZPfrXb2oKefP7Vtd5BdyegOs2S Wk3uu6wFRSRQ89YZgsX7n6K40EFTZ6rI2S/O/UTpoePQIIZqiG3SxUhLJwt9sN+lPgDAn+Dqi UUIw134UgCZvcKmIwFQu1yFzoVVjdCINPLW5141F7YiOHhXvf+fM5OydDRRRmwuIHbjtxeijp kn12Yh0st4lqhVrkS9AWfzFsilsArXT4rDaNPLdZalO8yu4FQn4eMCr7eQNY3QvptKUXptPgn bpv5BmpmLUfvv3TSCyXnHUytskc4+I From: cmbecker69@gmx.de ("Christoph M. Becker") On 31.12.2024 at 16:54, Giovanni Giacobbi wrote: > The idea being, can we provide the most expensive operation, that is bas= ic > pixel by pixel comparison, as native function? Otherwise we keep discuss= ing > bikeshedding and years go by without this being available. This does not > stop future more advanced comparison algorithms from being introduced (i= .e. > imagediff()). Okay, I basically agree. And given that this need is not urgent for libgd per se (C clients can write their own functions without having a performance impact), it is in my opionion fine to have some image comparision in our extension binding, not necessarily using a function provided by libgd. > Then we have the transparent pixel. Should equality comparison take >> that into account? Again, in theory, it is not the same as a pixel wit= h >> alpha channel 127, but in practice it may very well be. > > Yes. Overlaying a black 100% opaque pixel is different from overlaying 5= 0% > black pixel, on a non-black surface. Again result is "rendering oriented= ". Oh, there is some misunderstanding here. In libgd, an alpha channel value of 127 is maximum transparency (same as opacity:0 for CSS). However, I'm talking about the special concept of the transparent pixel (see imagecolortransparent()). This can be an arbitrary pixel value (usually only used for palette images, but also at least partially supported for truecolor images). That pixel value does not even need to have an alpha channel greater than zero (note again, libgd alpha zero is like CSS opacity:1), nor would its RGB values matter. This transparent pixel is typically used with GIF, but also supported for PNG, and maybe some other image formats. > I'm happy to run a quick bechmark and provider results, but my feeling i= s > we are talking orders of magnitude (without jit, i personally don't > consider it production ready). But I will also benchmarm it with JIT > enabled. Yes, please do some performance comparisons. I didn't notice much difference when working on PR #17305; at least not an order of magnitude. Christoph