IRONSOFTWAREHOME
获取颜色深度
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) 来衡量,用于提供有关颜色分量的信息。 这要么是指用于指示单个像素颜色的位数,要么是指用于指示单个像素每个颜色分量的位数。 它还可以用来确定图像的质量,因为不同的图像 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 20,033,450版本:2025.3刚刚发布

Key in blue circle

立即获取免费的 30 天试用版密钥

Your trial license will be sent to your email address

无任何限制。100% 解锁。无需信用卡。

OR
bullet_checked无需信用卡或创建账户无任何限制。100% 解锁。无需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried Iron Suite
获取您的无义务咨询
填写下面的表格或通过sales@ironsoftware.com
您的资料将始终保密。
深受全球数百万工程师信赖
Iron Software 的客户徽标
立即获取您的免费30 天试用密钥
无需信用卡或创建账户