カラー深度を取得
using IronSoftware.Drawing;
using System;

// Load an AnyBitmap from a file
AnyBitmap sample = AnyBitmap.FromFile(@"FILE_PATH");

// Gets and prints the color depth in terms of bits per pixel
var colorDepth = sample.BitsPerPixel;
Console.WriteLine(colorDepth);
NuGet Download
PM > Install-Package IronSoftware.System.Drawing
カラー深度を取得

カラー深度を取得

色深度はピクセルあたりのビット数 (bpp) で測定され、色成分に関する情報を提供するために使用されます。 これは、1 つのピクセルの色を示すために使用されるビット、または 1 つのピクセルの各色コンポーネントに使用されるビット数のいずれかです。 また、画像の bpp が異なると画像の品質も変化するため (通常、bpp が高いほど画像の鮮明度が高くなります)、画像の品質を判断するためにも使用できます。

画像ファイルはAnyBitmap.FromFile("FILE_PATH")を使用してファイルパスから読み取ることができます。 You can then use .BitsPerPixel on the generated AnyBitmap object to get the color depth of the image.

GitHubで見る

準備はできましたか?

Nuget Downloads 21,321,696バージョン:2026.11リリースされたばかり