本文介绍了将 RGB 转换为 HSV 并将 HSV 转换为 RGB 的算法,范围为 0-255的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
我正在寻找从 RGB 到 HSV 的颜色空间转换器,特别是对于两个颜色空间的 0 到 255 范围.
I am looking for color space converter from RGB to HSV, specifically for the range 0 to 255 for both color spaces.
推荐答案
我已经使用这些很长时间了 - 现在不知道它们来自哪里......注意输入和输出,除了角度以度为单位,范围为 0 到 1.0.
I've used these for a long time - no idea where they came from at this point... Note that the inputs and outputs, except for the angle in degrees, are in the range of 0 to 1.0.
注意:此代码不会对输入进行真正的健全性检查.谨慎行事!
NOTE: this code does no real sanity checking on inputs. Proceed with caution!
这篇关于将 RGB 转换为 HSV 并将 HSV 转换为 RGB 的算法,范围为 0-255的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!