相关疑难解决方法(0)

在Python中将十六进制字符串转换为int

如何在Python中将十六进制字符串转换为int?

我可以把它作为" 0xffff"或只是" ffff".

python string hex

708
推荐指数
7
解决办法
84万
查看次数

将十六进制值转换为python中的颜色名称

我的程序输出十六进制值,例如 (#673429ff)。
我想将其转换为颜色名称。我怎样才能得到颜色名称?我正在使用 python。这是我代码的最后一部分:

index_max = scipy.argmax(counts)                    # find most frequent
peak = codes[index_max]
colour = binascii.hexlify(bytearray(int(c) for c in peak)).decode('ascii')
print('most frequent is %s (#%s)' % (peak, colour))
Run Code Online (Sandbox Code Playgroud)

python rgb hex image image-processing

1
推荐指数
1
解决办法
4594
查看次数

标签 统计

hex ×2

python ×2

image ×1

image-processing ×1

rgb ×1

string ×1