1

PythonMagick内から(私が考えているタプルとして??)ヒストグラムにアクセスすることは可能ですか?

#!/usr/bin/env python
import PythonMagick

img = PythonMagick.Image("c:\\temp\\temp\\sample_image.jpg")

h = img.convert().histogram() # pseudo code for the following command line:
# convert sample_image.jpg -define histogram:unique-colors=true -format %c histogram:info:

この質問によく似ていますが、Python 内で結果を使用したいだけです。また、ヒストグラムをテキスト ファイルとして書き出すことに頼る必要もありません。それを Python にインポートすると、冗長ではないにしても少し遅くなります。

4

0 に答える 0