Java code to give an image sketch effect[ and other interesting/fun effects] [closed]

此生再无相见时 提交于 2019-12-08 10:43:00

问题


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

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?

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?


回答1:


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.

Pseudocode looks like following..

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 image filters

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 :) )




回答2:


The Java Advanced Imaging library has some demos which shows some basic effects on images.



来源:https://stackoverflow.com/questions/5807539/java-code-to-give-an-image-sketch-effect-and-other-interesting-fun-effects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!