Java代码赋予图像素描效果[和其他有趣/有趣的效果] [英] Java code to give an image sketch effect[ and other interesting/fun effects]

查看:262
本文介绍了Java代码赋予图像素描效果[和其他有趣/有趣的效果]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个需要将彩色图像转换为铅笔素描的应用程序,例如

I'm creating an application for which I need to convert color images to pencil sketches, for example see this.

使用Java修改草图生成中实现会产生类似效果,但不会正是我想要的(如上面的示例所示). 有人可以告诉我如何在Java中获得所需的素描效果吗?

answer at Implementing Modified Sketch generation in Java gives similar effect but not quite what I want(as shown in the example above). Can someone tell me how to get the desired sketch effect in java?

还有,是否有任何食谱类型的资源/博客/书籍/开放源代码库显示对图像具有各种有趣效果的java(或任何其他语言)代码?

Also, are there any cookbook type resources/blogs/books/open-source-library which show the java(or any other language) code for various kind of fun looking effects to images?

推荐答案

在最近的几天里,我对此进行了研究,并能够使用Java获得所需的草图效果.我已经发布了在我的博客上.

In last couple of days I researched this and was able to get the desired sketch effect using java. I've posted it on my blog.

伪代码如下所示.

s = Read-File-Into-Image("/path/to/image")
g = Convert-To-Gray-Scale(s)
i = Invert-Colors(g)
b = Apply-Gaussian-Blur(i)
result = Color-Dodge-Blend-Merge(b,g)

我发现以下开源代码很有用...

I found following open source code useful...

JH Labs图像过滤器

处理编程语言( http://code.google.com/p/processing/)(无法将其设置为超链接,似乎我没有足够的声誉来发布更多内容超过2个超链接:))

Processing Programming Language (http://code.google.com/p/processing/)(couldn't make this a hyperlink, it seems I don't have enough reputation to post more than 2 hyperlinks :) )

这篇关于Java代码赋予图像素描效果[和其他有趣/有趣的效果]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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