Skip to content

Slackのロゴでモザイクアートを作成しようとしたところ、IndexErrorが解決できない #12

@ftnext

Description

@ftnext

1/16のデモ中に発生。

対象画像:
http://iosicongallery.com/img/512/slack-2014-10-07.png

モザイクアート作成用のディレクトリに保存し、ソースコードで対象ファイル名を変更。
モザイクアート作成を実行したところ、以下のエラーが出た。

  File "mosaic_art.py", line 114, in <module>
    main()
  File "mosaic_art.py", line 28, in main
    left+DOT_AREA_ONE_SIDE, top+DOT_AREA_ONE_SIDE)
  File "[パスの一部を省略]/20171202mosaic-art-python/mosaic_art/calc.py", line 30, in average_color_in_range
    green = round(mean_color[1])
IndexError: list index out of range

画像のサイズが512×512と10の倍数でないことが原因かと考え、
うまくいっている画像と同じ400×400サイズにしたが、
同じエラーが出て解決できなかった。

画像の問題の可能性があるので、ログを仕込んで原因を調査する想定。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions