项目作者: CODESIGN2

项目描述 :
scripted image transform. PoC
高级语言: Python
项目地址: git://github.com/CODESIGN2/smart-object.git
创建时间: 2018-03-18T21:09:00Z
项目社区:https://github.com/CODESIGN2/smart-object

开源协议:GNU Affero General Public License v3.0

下载


smart-object

scripted image transform. PoC



Inspiration came from this UI. It's basically hotspots on an image that allow you to embed other images. Cool web-based dialogue, but closed source, slow

Inspiration came from this UI. It’s basically hotspots on an image that allow you to embed other images. Cool web-based dialogue, but closed source, slow

Remit?

As nothing on the linked site uses curved sides or any complex features (which could be supported via masks), then it seems easy to just store two sets of four points.
The second set are for top-left, top-right, bottom-left and bottom-right destinations for the passed in image. The first set can be derrived from the image, such that (0,0) will always be top-left, (width-1,height-1) will always be bottom-right (note in the initial test we overrun by 1px). top-right and bottom-left are (width-1,0) & (0,height-1) respectively.



Diagram attempting to visualise how the corners translate

Diagram attempting to visualise how the corners translate

How does this enable smart-objects?

Firstly it enables output of a scripted, repeatable image from an original source image. From that point anything done to the source can be translated to the output. From there it can be put into the regular compositing chain, either via CLI tools like imagemagick (used here), or in more complex GUI applications.



How this fits into the larger picture

How this fits into the larger picture

Work to be done

  • GUI’s & non-CLI scripts to demo
  • Higher-order Structures
  • Flourishes (like adding a sheen layer, working with SVG, etc)