- 项目地址
- https://github.com/beurtschipper/Depix
- 立项背景:
CTF比赛杂项题有马赛克图片,是经过特定的方式对原图进行处理,具体原理还未深究,该项目通过辅助图片对马赛克图片进行“复原”,进而为解题提供线索或直接拿到flag。
- py文件位置运行
-
python depix.py -p [pixelated rectangle image] -s [search sequence image] -o output.png
- -p 后面接打了马赛克的图片的地址
- -s 辅助解码的图片,在\images\searchimages下
- 测试图片和辅助图片都在image文件夹中有
- 如果python不行就换成python3
- 遇到什么问题去官网下的论坛找解决方案
- https://github.com/beurtschipper/Depix/issues/12
-
haoyun@HAOYUN Depix % python3 depix.py -p /Users/haoyun/Desktop/git/Depix/images/testimages/testimage3_pixels.png -s /Users/haoyun/Desktop/git/Depix/images/searchimages/debruinseq_notepad_Windows10_closeAndSpaced.png -o output.png #举例,自己改下路径就行 INFO:root:Loading pixelated image from /Users/haoyun/Desktop/git/Depix/images/testimages/testimage3_pixels.png INFO:root:Loading search image from /Users/haoyun/Desktop/git/Depix/images/searchimages/debruinseq_notepad_Windows10_closeAndSpaced.png INFO:root:Finding color rectangles from pixelated space INFO:root:Found 116 same color rectangles INFO:root:86 rectangles left after moot filter INFO:root:Found 1 different rectangle sizes INFO:root:Finding matches in search image INFO:root:Removing blocks with no matches INFO:root:Splitting single matches and multiple matches INFO:root:[10 straight matches | 76 multiple matches] INFO:root:Trying geometrical matches on single-match squares INFO:root:[15 straight matches | 71 multiple matches] INFO:root:Trying another pass on geometrical matches INFO:root:[17 straight matches | 69 multiple matches] INFO:root:Writing single match results to output INFO:root:Writing average results for multiple matches to output INFO:root:Saving output image to: output.png #最后执行成功,时间有点久 123456789101112131415161718192021222324
- 遇到问题
-
Traceback (most recent call last): File "depix.py", line 1, in <module> from depixlib.LoadedImage import * File "/Users/haoyun/Desktop/git/Depix/depixlib/LoadedImage.py", line 1, in <module> from PIL import Image ImportError: No module named PIL 123456
-
pip3 install -r requirements.txt #尝试
- 成功运行
- 输出结果展示
分类: 其他