Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以假设有一些 SVG 文件也可能有一些位图对象。我需要的是某种方法来确定坐标 X、Y 的像素颜色。与“滴管工具”的功能基本相同,但从命令行或从 inkscape python 扩展中调用它。
您可以使用 inkscape 二进制文件导出图像,然后使用脚本语言(例如 PHP)进行采样:
inkscape --without-gui --export-png=myfile.png --export-dpi=100 myfile.svg
如果不设置 DPI,则默认为 90。
我想你也可以在 Python 扩展中做到这一点,但我无能为力 - 但可能有文档。