Cache 圖片格式的選擇

來源:互聯網
上載者:User

    產生ags cache圖片之後,不少人應該碰到過這樣的問題,切過的圖片有很明顯的噪點,有時甚至左邊的切片顯示正常,右邊確有噪點,造成左右差異的原因目前還不知道,但消除噪點的方法就是使用PNG32格式進行切圖。

    如果大家做過網頁設計,應該記得PNG圖片和部分瀏覽器不相容,特別是部分格式的透明效果很難實現,ags官方部落格上最近給出了專業建議:

  • PNG8 - Use this format for overlay services that need to have a transparent background, such as roads and boundaries. PNG 8 creates tiles of very small size on disk with no loss of information. However, you should use a different PNG format if your map contains more than 256 colors. Imagery, hillshades, gradient fills, transparency, and the antialiasing caching option can easily push your map over 256 colors.
  • PNG24 - You can use this format for overlay services, such as roads and boundaries, that have more than 256 colors (if fewer than 256 colors, use PNG 8). Do not use PNG 24 if your tiles will be viewed in Internet Explorer version 6 or previous.
  • PNG32 - Use this format for overlay services, such as roads and boundaries, that have more than 256 colors. This format creates larger tiles than PNG 24, but the tiles are fully supported in all browsers.
  • JPEG - Use this format for base map services that have large color variation and do not need to have a transparent background. For example, raster imagery tends to work well with JPEG.

        很容易理解為什麼PNG8容易出現噪點了,因為我們的資料底圖很容易超過256色,8位元影像片顯然無法滿足基本要求,雖然PNG32檔案比PNG8和PNG24相對要大,但正式項目中我還是傾向於它,出色顯示效果,對主流瀏覽器的完美支援就足以堅定我們的信心,多出的檔案大小就讓海量硬碟去消化吧。

        為柵格、向量圖層做cache時,一定要先取地圖的小部分地區檢驗切片效果,避免上機就做完整切圖,最後多天的等待之後發現前功盡棄。做cache的電腦,建議為高效能PC或工作站,CPU和穩定性是關鍵。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.