久久久久久久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 - 替換圖像中的顏色的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  希望有人能幫忙

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

                  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.

                  我要做的是在屏蔽圖像之前用類似的顏色(例如 0,0,254)替換任何出現的鍵控顏色 (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 的解決方案,因為它們已編入索引..

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

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

                  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.

                  謝謝,

                  推薦答案

                  您需要打開輸入文件并掃描每個像素以檢查色鍵值.

                  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;
                  }
                  

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

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

                  相關文檔推薦

                  enable SOAP on PHP(在 PHP 上啟用 SOAP)
                  Get received XML from PHP SOAP Server(從 PHP SOAP 服務器獲取接收到的 XML)
                  not a valid AllXsd value(不是有效的 AllXsd 值)
                  PHP SoapClient: SoapFault exception Could not connect to host(PHP SoapClient:SoapFault 異常無法連接到主機)
                  Implementation of P_SHA1 algorithm in PHP(PHP中P_SHA1算法的實現)
                  Sending a byte array from PHP to WCF(將字節數組從 PHP 發送到 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>
                            主站蜘蛛池模板: 日韩在线精品 | 久久久久久91香蕉国产 | 国产成人99久久亚洲综合精品 | 日韩精品成人网 | 午夜精品一区二区三区三上悠亚 | 国产高清美女一级a毛片久久w | 美女毛片 | 久草电影网| 国产一区在线视频 | 日韩中文在线视频 | 欧美日一区二区 | 亚洲欧美激情网 | 欧美视频福利 | 99精品亚洲国产精品久久不卡 | 日韩免费网站 | 99久久婷婷国产综合精品 | 久久成人在线视频 | 欧美在线观看免费观看视频 | 国产一二三区精品视频 | 午夜成人在线视频 | 亚洲国产中文在线 | 99精品欧美一区二区蜜桃免费 | 极品粉嫩国产48尤物在线播放 | 成人欧美一区二区三区黑人孕妇 | 日韩在线视频一区二区三区 | 欧美久久一区 | 国产精品视频久久 | 欧美色综合一区二区三区 | 国产黄色小视频在线观看 | 久久这里只有精品首页 | 国内激情av片 | 午夜精品久久久久久久99黑人 | 亚洲免费在线视频 | 一区二区视频在线 | 91精品国产乱码久久久久久久久 | 亚洲女人天堂网 | 亚洲狠狠丁香婷婷综合久久久 | 久久久久国产一区二区三区四区 | 日韩高清中文字幕 | 岛国午夜 | 米奇7777狠狠狠狠视频 |