简体   繁体   English

用于图像渲染的MVC-特别是在python中(PIL或Pillow)

[英]MVC for image rendering - Specifically in python (PIL or Pillow)

Separation of concerns is important for making code maintainable. 关注点分离对于使代码可维护很重要。 Anybody aware of already built frameworks that implement perhaps an MVC approach for image rendering with for example PIL (or pillow ) 任何人都知道已经构建的框架,这些框架可能实现了MVC方法,例如使用PIL (或枕头 )进行图像渲染。

It is probably not too hard to come up with such a framework, but any existing best practices would help navigate the waters of repeating mistakes, etc. 提出这样一个框架可能不太难,但是任何现有的最佳实践都将有助于解决重复错误等问题。

Edit: To be clear, my request is regarding creating a new image by combining and overlaying other images. 编辑:明确地说,我的要求是关于通过合并和覆盖其他图像来创建新图像。 Perhaps the analogy can be a framework like django which uses models to generate html pages ... similarly this framework or architecture would allow for generating dynamic png's from a dynamic dataset. 此类比喻可能是类似django的框架,该框架使用模型来生成html页面……类似地,该框架或体系结构将允许从动态数据集中生成动态png。

Here's a resource that provides many examples of server-side image resizing. 这是提供许多服务器端图像大小调整示例的资源。

https://github.com/adamdbradley/foresight.js/wiki/Server-Resizing-Images https://github.com/adamdbradley/foresight.js/wiki/Server-Resizing-Images

I'm not sure if any of them would meet the needs of your project as is, but I'm sure there's some take aways from their implementations that you can apply to your own project. 我不确定它们中的任何一个是否能满足您项目的需求,但是我敢肯定,您可以将它们的实现应用于您自己的项目中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM