Writing 32 bit images

 採用された回答

Walter Roberson
Walter Roberson 2011 年 4 月 27 日

0 投票

How many color channels are you using, and how many bits do you require for each of the color channels?
Does the file have to be directly decodable by an external viewer as 32 bits, or is it sufficient that you can recover the 32 bits upon reading it in?
Your options:
  • PNG file with bitdepth of 8 (bits per channel) to encode 24 of the bits, and specify a uint8 alpha map for the remaining 8 bits
  • Sun RAS file passed an RGB image that is uint8 per channel, and a uint8 alpha map
  • TIFF with a M x N x 4 uint8 matrix passed in, which would cause TIFF to think of the file as being CMYK
  • PNG with a bitdepth of 16 (per channel) and passing a 3 channel uint16 matrix, resulting in a 48 bit per pixel image

9 件のコメント

Mohsin Shah
Mohsin Shah 2011 年 4 月 27 日
how to change alpha channel in 32 bit bitmap/png image?
I want to replace the orignal alpha channel to my own values at each pixel.
Walter Roberson
Walter Roberson 2011 年 4 月 27 日
[IMG, map, IMGalpha] = imread('YourFile.png');
Newalpha = .... %as appropriate
imwrite('YourNewFile.png', IMG, 'Alpha', Newalpha);
Mohsin Shah
Mohsin Shah 2011 年 4 月 27 日
You tell the code for alpha changing
but it give error of invalid attribute.
please correct the code.
Walter Roberson
Walter Roberson 2011 年 4 月 27 日
imwrite(IMG,'YourNewFile.png', 'png', 'Alpha', Newalpha)
Mohsin Shah
Mohsin Shah 2011 年 4 月 28 日
Thanks That's Right.
Mohsin Shah
Mohsin Shah 2011 年 4 月 28 日
How to show the image in 32 bit's with 8 bit's alpha channel.
Walter Roberson
Walter Roberson 2011 年 4 月 28 日
image(IMG, 'AlphaData', IMGalpha)
Zakir
Zakir 2011 年 5 月 26 日
Hi!
May you tell me ?
1-how to read the alpha channel?
2-How to set new alpha channel of a image?
3-how to show image with alpha channel?
Walter Roberson
Walter Roberson 2011 年 5 月 26 日
If you look above your comment, you will find something that says "Show older comments". Click on that. The code you ask for is there.

サインインしてコメントする。

その他の回答 (1 件)

John
John 2011 年 5 月 3 日

0 投票

The Tiff class was introduced in R2009b, which allows one to create TIFFs with a variety of configurations, including 32-bit floating point, 8-bit RGB with an alpha layer, and others.

カテゴリ

ヘルプ センター および File ExchangeConvert Image Type についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by