久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

        <tfoot id='YzYxr'></tfoot>
        <legend id='YzYxr'><style id='YzYxr'><dir id='YzYxr'><q id='YzYxr'></q></dir></style></legend>
      1. <i id='YzYxr'><tr id='YzYxr'><dt id='YzYxr'><q id='YzYxr'><span id='YzYxr'><b id='YzYxr'><form id='YzYxr'><ins id='YzYxr'></ins><ul id='YzYxr'></ul><sub id='YzYxr'></sub></form><legend id='YzYxr'></legend><bdo id='YzYxr'><pre id='YzYxr'><center id='YzYxr'></center></pre></bdo></b><th id='YzYxr'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='YzYxr'><tfoot id='YzYxr'></tfoot><dl id='YzYxr'><fieldset id='YzYxr'></fieldset></dl></div>
        • <bdo id='YzYxr'></bdo><ul id='YzYxr'></ul>

        <small id='YzYxr'></small><noframes id='YzYxr'>

        PHP - 替換圖像中的顏色

        PHP - Replace colour within image(PHP - 替換圖像中的顏色)

          <i id='DEWCQ'><tr id='DEWCQ'><dt id='DEWCQ'><q id='DEWCQ'><span id='DEWCQ'><b id='DEWCQ'><form id='DEWCQ'><ins id='DEWCQ'></ins><ul id='DEWCQ'></ul><sub id='DEWCQ'></sub></form><legend id='DEWCQ'></legend><bdo id='DEWCQ'><pre id='DEWCQ'><center id='DEWCQ'></center></pre></bdo></b><th id='DEWCQ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='DEWCQ'><tfoot id='DEWCQ'></tfoot><dl id='DEWCQ'><fieldset id='DEWCQ'></fieldset></dl></div>

            1. <legend id='DEWCQ'><style id='DEWCQ'><dir id='DEWCQ'><q id='DEWCQ'></q></dir></style></legend>
              • <tfoot id='DEWCQ'></tfoot>

                <small id='DEWCQ'></small><noframes id='DEWCQ'>

                • <bdo id='DEWCQ'></bdo><ul id='DEWCQ'></ul>
                    <tbody id='DEWCQ'></tbody>

                  本文介紹了PHP - 替換圖像中的顏色的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  希望有人能幫忙

                  我制作了一個(gè)屏蔽圖像的腳本......但是它依賴(lài)于一種顏色來(lái)屏蔽(綠屏"樣式).問(wèn)題是,如果我屏蔽的圖像包含那種顏色,它就會(huì)被破壞.

                  I have made a script that masks images... however it is reliant on a colour to mask with ( 'green screen' style). The trouble is if the image that I am masking contains that colour it is ruined.

                  我要做的是在屏蔽圖像之前用類(lèi)似的顏色(例如 0,0,254)替換任何出現(xiàn)的鍵控顏色 (0,0,255).

                  What I am looking to do is prior to masking the image replace any occurance of my keying colour (0,0,255) with a similar colour such as 0,0,254.

                  我找到了一些基于 gif 或 256 色 PNG 的解決方案,因?yàn)樗鼈円丫幦胨饕?.

                  I have found a few solutions based around gif's or 256 colour PNG as they are indexed..

                  所以我的問(wèn)題也是將其轉(zhuǎn)換為 gif 或 256 png 然后查看索引并替換顏色或搜索每個(gè)像素并替換顏色是否更有效.

                  So my question is also will it be more efficient to convert it to a gif or 256 png then look through the index and replace the colour or search through every pixel and replace the colours.

                  謝謝,

                  推薦答案

                  您需要打開(kāi)輸入文件并掃描每個(gè)像素以檢查色鍵值.

                  You need to open the input file and scan each pixel to check for your chromokey value.

                  像這樣:

                  // Open input and output image
                  $src = imagecreatefromJPEG('input.jpg') or die('Problem with source');
                  $out = ImageCreateTrueColor(imagesx($src),imagesy($src)) or die('Problem In Creating image');
                  
                  // scan image pixels
                  for ($x = 0; $x < imagesx($src); $x++) {
                      for ($y = 0; $y < imagesy($src); $y++) {
                          $src_pix = imagecolorat($src,$x,$y);
                          $src_pix_array = rgb_to_array($src_pix);
                  
                              // check for chromakey color
                              if ($src_pix_array[0] == 0 && $src_pix_array[1] == 0 && $src_pix_array[2] == 255) {
                                  $src_pix_array[2] = 254;
                              }
                  
                  
                          imagesetpixel($out, $x, $y, imagecolorallocate($out, $src_pix_array[0], $src_pix_array[1], $src_pix_array[2]));
                      }
                  }
                  
                  
                  // write $out to disc
                  
                  imagejpeg($out, 'output.jpg',100) or die('Problem saving output image');
                  imagedestroy($out);
                  
                  // split rgb to components
                  function rgb_to_array($rgb) {
                      $a[0] = ($rgb >> 16) & 0xFF;
                      $a[1] = ($rgb >> 8) & 0xFF;
                      $a[2] = $rgb & 0xFF;
                  
                      return $a;
                  }
                  

                  這篇關(guān)于PHP - 替換圖像中的顏色的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  enable SOAP on PHP(在 PHP 上啟用 SOAP)
                  Get received XML from PHP SOAP Server(從 PHP SOAP 服務(wù)器獲取接收到的 XML)
                  not a valid AllXsd value(不是有效的 AllXsd 值)
                  PHP SoapClient: SoapFault exception Could not connect to host(PHP SoapClient:SoapFault 異常無(wú)法連接到主機(jī))
                  Implementation of P_SHA1 algorithm in PHP(PHP中P_SHA1算法的實(shí)現(xiàn))
                  Sending a byte array from PHP to WCF(將字節(jié)數(shù)組從 PHP 發(fā)送到 WCF)
                  <i id='ArtHg'><tr id='ArtHg'><dt id='ArtHg'><q id='ArtHg'><span id='ArtHg'><b id='ArtHg'><form id='ArtHg'><ins id='ArtHg'></ins><ul id='ArtHg'></ul><sub id='ArtHg'></sub></form><legend id='ArtHg'></legend><bdo id='ArtHg'><pre id='ArtHg'><center id='ArtHg'></center></pre></bdo></b><th id='ArtHg'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ArtHg'><tfoot id='ArtHg'></tfoot><dl id='ArtHg'><fieldset id='ArtHg'></fieldset></dl></div>

                        <bdo id='ArtHg'></bdo><ul id='ArtHg'></ul>

                            <tbody id='ArtHg'></tbody>

                          <small id='ArtHg'></small><noframes id='ArtHg'>

                          • <tfoot id='ArtHg'></tfoot>
                            <legend id='ArtHg'><style id='ArtHg'><dir id='ArtHg'><q id='ArtHg'></q></dir></style></legend>
                            主站蜘蛛池模板: 婷婷丁香在线视频 | 欧美在线视频免费 | 99pao成人国产永久免费视频 | 华人黄网站大全 | 激情欧美一区二区三区中文字幕 | 欧美freesex黑人又粗又大 | 成人av电影在线观看 | 91国内精精品久久久久久婷婷 | 精品国产欧美 | 亚洲综合色 | 国产精品久久久精品 | 欧美精 | 亚洲一区二区三区免费在线观看 | 91av在线免费观看 | 国产激情在线 | 欧美xxxx色视频在线观看免费 | 一级免费a| 国产精品成人一区二区三区夜夜夜 | 欧美日本一区二区 | 免费观看一级视频 | 激情福利视频 | 亚洲精品自在在线观看 | 日韩爱爱网站 | 九九久久精品 | 国产传媒毛片精品视频第一次 | 91久久久久久 | 亚洲二区在线 | 国产丝袜一区二区三区免费视频 | 亚洲欧美中文日韩在线v日本 | 日韩精品一区二区三区免费观看 | 欧美成年网站 | 久久综合久久综合久久 | 一区二区三区免费看 | 国产一区二区三区日韩 | aaaaaa大片免费看最大的 | 色网站入口 | 欧美日韩高清 | 欧美一区二区三区视频 | 日本成人综合 | 99久久99热这里只有精品 | 久久国产精品免费一区二区三区 |