简体   繁体   English

查找上载图像中的颜色数量(忽略抗锯齿/压缩伪像)?

[英]Finding number of colors in an uploaded image (ignoring anti-aliasing/compression artifacts)?

is there a way to find the number of colors in an uploaded image, ignoring the compression artifacts and anti-aliasing between colors? 有没有一种方法可以找到上载图像中的颜色数量,而忽略压缩伪像和颜色之间的抗锯齿?

I am creating a design tool that allows users to upload images, and I want it to return prices (which are based on colors in the image) in real-time without someone having to manually check each upload. 我正在创建一个允许用户上传图像的设计工具,我希望它实时返回价格(基于图像的颜色),而无需人工检查每个上传的价格。

Only need 99% accuracy, fringe cases are okay. 只需要99%的精度,边缘盒就可以了。

You'll have a tough time finding a pre-existing method for this. 您将很难为此找到一个预先存在的方法。 Spot colors such as Pantone Color matching System aren't color spaces, they are matching systems. Pantone色彩匹配系统等专色不是色彩空间,它们是匹配系统。 As far as I know, there is no way to auto-detect PMS or other such matching systems. 据我所知,没有办法自动检测PMS或其他此类匹配系统。

Edit based on comment below: 根据以下评论进行编辑:

Try using http://www.php.net/manual/en/imagick.getimagecolors.php 尝试使用http://www.php.net/manual/zh-CN/imagick.getimagecolors.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM