Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image to pencil sketch module. #993

Open
harshithpabbati opened this issue Apr 6, 2019 · 35 comments · May be fixed by #1450
Open

Image to pencil sketch module. #993

harshithpabbati opened this issue Apr 6, 2019 · 35 comments · May be fixed by #1450

Comments

@harshithpabbati
Copy link

A module which converts image into pencil sketch.

Thank you!

Your help makes Public Lab better! We deeply appreciate your helping refine and improve this site.

To learn how to write really great issues, which increases the chances they'll be resolved, see:

https://publiclab.org/wiki/developers#Contributing+for+non-coders

@harshithpabbati
Copy link
Author

I want to work on this by creating a meta module.
imagesketch
Does this looks like a image sketch.

@harshkhandeparkar
Copy link
Member

Is this an edge detect meta module?

@harshkhandeparkar
Copy link
Member

You can invert edge detect to do this

@harshkhandeparkar
Copy link
Member

But it will take vwry long to process

@harshkhandeparkar
Copy link
Member

And the image doesn't look quite like a sketch

@harshkhandeparkar
Copy link
Member

It needs some shading

@harshithpabbati
Copy link
Author

I did the same thing inverted edge detect.

@harshithpabbati
Copy link
Author

I made the hysteresis false so it doesn't take much time.

@harshkhandeparkar
Copy link
Member

harshkhandeparkar commented Apr 6, 2019 via email

@harshithpabbati
Copy link
Author

But still it needs some effect to look like a sketch.

@grvsachdeva
Copy link
Member

grvsachdeva commented Apr 14, 2019

@jywarren @tech4GT any thoughts?

@harshkhandeparkar
Copy link
Member

Can this be achieved through a simple filter? Or maybe separabale filters + post processing? @tech4GT do you know anything this?

@harshkhandeparkar
Copy link
Member

Anything about this*

@harshkhandeparkar
Copy link
Member

I created this by mistake

edge-detect

Does it look like a pencil sketch? @gauravano @harshithpabbati @publiclab/is-reviewers @jywarren

@harshkhandeparkar
Copy link
Member

Anyone would be surprised to know that it only contains pure black or pure white pixels, no intermediate

@harshithpabbati
Copy link
Author

@harshkhandeparkar lets make a trail invert it :)

@harshithpabbati
Copy link
Author

May be invert module makes it to look more like a sketch module.

@harshkhandeparkar
Copy link
Member

It is actually edge detect

@harshithpabbati
Copy link
Author

Yeah I know.

@harshkhandeparkar
Copy link
Member

I created it by mistake when I was finding opportunities for GPU accelerating edge-detect.

@harshithpabbati
Copy link
Author

May be you can open a pr this will improve the edge detect module.

@harshkhandeparkar
Copy link
Member

How will this improve edgeDetect?

@harshithpabbati
Copy link
Author

It's edge detect module right?

@harshithpabbati
Copy link
Author

Didn't you change anything in it?

@harshkhandeparkar
Copy link
Member

I did remove gaussian blur from it

@harshkhandeparkar
Copy link
Member

@harshithpabbati I tried to reproduce the same img but I am not able to. I forgot what I had done yesterday 😅. Sorry.

@harshkhandeparkar
Copy link
Member

Ok new plan:

  1. Turn the image to greyscale(colormap)
  2. Run some kind of a filter over it to get this effect.(convolution)

@rishabhshuklax
Copy link
Member

rishabhshuklax commented Dec 28, 2019

Does this looks like a image sketch? I followed this article.
Screenshot from 2019-12-29 01-29-21
@harshithpabbati @jywarren @harshkhandeparkar

@harshkhandeparkar
Copy link
Member

I think it looks a bit more like pastel colors or watercolors. Maybe it needs to have some lines or gaps in between. We need to convolve some kind of filter.

@harshkhandeparkar
Copy link
Member

I think we'll have to do some google research.

@ataata107
Copy link

yo
yo2

I was able to reproduce sketching in python. It may be possible for me to convert this into js. Can I proceed to this in javascript if you guys find the above results suitable.
@harshkhandeparkar @blurry-x-face

@rishabhshuklax
Copy link
Member

Hi @ataata107 , I was also working on it and made this below image by

  1. Greyscale(using color map)
  2. Invert image
  3. Blur
  4. Blending the Greyscale and Blur image by using Color Dodge blend method(We don't currently support blending two images using color dodge but I am working on it I used a third party app for blending the two images)

Screenshot from 2020-01-02 19-16-14

If this looks good enough we can create this as a meta module.

@rishabhshuklax
Copy link
Member

Also I found this project https://github.com/geraintluff/canvas-sketch if you could make something like this it looks really cool, It would be really great @ataata107

@ataata107
Copy link

On it

@ataata107
Copy link

ataata107 commented Jan 7, 2020

https://github.com/geraintluff/canvas-sketch
@blurry-x-face the above method transforms the canvas rather than the image as it put linestrokes on the canvas.
I guess the real image needs to be transformed rather than the display canvas.

@ataata107 ataata107 linked a pull request Jan 9, 2020 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants