字肖像可视化 [英] Word Portraits visualization

查看:183
本文介绍了字肖像可视化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我去了这个可视化和它的调用Word肖像:

I stopped by this visualization and it's called Word Portrait:

我的问题是:如何做这样的事情?是否有教程或论文,描述了这一点?

My question is: how to do something like this? Is there a tutorial or a paper that describes this?

推荐答案

我新的看见,但我在过去这是类似做位图ASCII艺术转换器。所以从我的角度我认为是这样的:

I newer saw this but I did bitmap to ASCII art converter in the past which is similar. so from my point of view I see it like this:

  1. 带灰度图像和segmentate它(通过与固定纵横比的矩形区域)

  1. take gray-scale image and segmentate it (by rectangle areas with fixed aspect ratio)

宽高比由用于输入文本短语和字体给出。这会给你一个矩形的列表类似的颜色,以便计算平均颜色他们。另外一个好主意是限制分钟和段的最大尺寸

Aspect ratio is given by input text phrase and Font used. This will give you list of rectangles with similar colors so compute average color for them. Also a good idea is to limit min and max size of segments

  • 在过小的矩形不可读
  • 在过大的矩形是丑陋的(见最大的GENIUS)

按文本替换矩形段

字体大小由填充区域(矩形大小),这样的文字将适合它的限制。文本的平均颜色应该是相同的矩形段的平均色

Font size is limited by filled area (rectangle size) so text will fit into it. Average color of text should be the same as average color of rectangle segment

text_color=rectangle_avg_color*(ink_pixels+paper_pixels)/ink_pixels

ink_pixels paper_pixels 在渲染文本短语的像素数。如果你想实现彩色图像然后只是计算R,G,分别B值和颜色与亮度一次融合在一起或segmentate

ink_pixels and paper_pixels are the count of pixels in rendered text phrase. If you want to implement colored images then just compute R,G,B values separately and blend it together or segmentate by colors and intensities at once

请参阅图像到ASCII艺术转换它可以帮助你得到一些新的想法......

See Image to ASCII Art conversion it may help you got some new ideas ...

这篇关于字肖像可视化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆