It is currently Fri Jul 24, 2026 9:06 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Writing a script
PostPosted: Thu Jul 09, 2015 1:57 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Dec 22, 2011
Posts: 399
Hiya....was wondering if anybody could help me by writing a script/HTML code...I will pay for this.

Its for converting PNG image that had been indexed to a few colours to a written form so that it can be made into a pattern for crochet...1 pixel per stitch

This has been done for knitting but I would like some changes as it is for crochet...see link below
SourceForge
Because of malware being found in SourceForge downloads, this link has been removed.

Some of the changes would be pattern reading vertically rather than horizontal and some of the wording. I know you need more info but if anybody can help me please contact me and we can go from there.

Simple sample of pattern below

I would so appreciate this...TIA


Attachments:
Sample.jpg
Sample.jpg [ 61.46 KiB | Viewed 5366 times ]

_________________
Image
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 3:23 am  (#2) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
http://registry.gimp.org/node/28018

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 3:38 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
I may be able to help. Possibily with the design of a filter for the G'MIC plug-in that output the desired text file.
I'll try to start something this afternoon.


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 3:58 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Dec 22, 2011
Posts: 399
Ronounours wrote:
I may be able to help. Possibily with the design of a filter for the G'MIC plug-in that output the desired text file.
I'll try to start something this afternoon.

Thank you soo much :)

_________________
Image


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 4:59 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Deblk, I'm doing some progress...
You need to tell me what would be your preferred output. So far, I have something that does this :

From this image :

Attachment:
heart.png
heart.png [ 222 Bytes | Viewed 5267 times ]


It outputs this text file:

Quote:
Color #0: 0,0,0
Color #1: 80,0,0
Color #2: 80,80,80
Color #3: 160,0,0
Color #4: 240,0,0
Color #5: 240,80,80
Color #6: 240,160,160
Row #0: | 17 x Col#0
Row #1: | 3 x Col#2 | 4 x Col#0 | 4 x Col#2 | 3 x Col#0 | 3 x Col#2
Row #2: | 2 x Col#2 | 1 x Col#0 | 1 x Col#1 | 2 x Col#4 | 1 x Col#3 | 1 x Col#0 | 2 x Col#2 | 1 x Col#1 | 2 x Col#4 | 1 x Col#3 | 1 x Col#0 | 2 x Col#2
Row #3: | 1 x Col#2 | 1 x Col#0 | 1 x Col#1 | 1 x Col#4 | 2 x Col#6 | 1 x Col#4 | 1 x Col#3 | 1 x Col#0 | 1 x Col#1 | 4 x Col#4 | 1 x Col#3 | 1 x Col#0 | 1 x Col#2
Row #4: | 1 x Col#0 | 1 x Col#1 | 1 x Col#4 | 2 x Col#6 | 10 x Col#4 | 1 x Col#3 | 1 x Col#0
Row #5: | 1 x Col#0 | 1 x Col#3 | 1 x Col#5 | 1 x Col#6 | 11 x Col#4 | 1 x Col#3 | 1 x Col#0
Row #6: | 1 x Col#0 | 1 x Col#3 | 2 x Col#5 | 11 x Col#4 | 1 x Col#3 | 1 x Col#0
Row #7: | 1 x Col#0 | 1 x Col#3 | 13 x Col#4 | 1 x Col#3 | 1 x Col#0
Row #8: | 1 x Col#2 | 1 x Col#1 | 1 x Col#3 | 11 x Col#4 | 1 x Col#3 | 1 x Col#0 | 1 x Col#2
Row #9: | 1 x Col#2 | 1 x Col#0 | 1 x Col#3 | 11 x Col#4 | 1 x Col#3 | 1 x Col#0 | 1 x Col#2
Row #10: | 2 x Col#1 | 1 x Col#0 | 1 x Col#2 | 9 x Col#3 | 1 x Col#2 | 1 x Col#0 | 2 x Col#1
Row #11: | 3 x Col#1 | 1 x Col#0 | 1 x Col#2 | 7 x Col#3 | 1 x Col#2 | 1 x Col#0 | 3 x Col#1
Row #12: | 4 x Col#1 | 1 x Col#0 | 1 x Col#2 | 5 x Col#3 | 1 x Col#2 | 1 x Col#0 | 4 x Col#1
Row #13: | 5 x Col#1 | 1 x Col#0 | 1 x Col#2 | 3 x Col#3 | 1 x Col#2 | 1 x Col#0 | 5 x Col#1
Row #14: | 6 x Col#1 | 1 x Col#0 | 1 x Col#2 | 1 x Col#3 | 1 x Col#2 | 1 x Col#0 | 6 x Col#1
Row #15: | 7 x Col#1 | 3 x Col#0 | 7 x Col#1
Row #16: | 17 x Col#0


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 6:09 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
So here is a first attempt for your filter Debkl.
You should be able to find it in Testing / Ronounours / Output crochet patterns.

Attachment:
gmic_crochet.png
gmic_crochet.png [ 117.86 KiB | Viewed 5242 times ]


Let me know if you have ideas to improve it.
Here is the kind of files it generates :

Quote:
Image name: heart.png
Image size: 16x14

Number of colors: 4
Color #0: (0,0,0)
Color #1: (232,56,0)
Color #2: (248,240,168)
Color #3: (255,255,255)

Row #0: | 3 x #3 | 3 x #0 | 4 x #3 | 3 x #0 | 3 x #3
Row #1: | 2 x #3 | 1 x #0 | 3 x #2 | 1 x #0 | 2 x #3 | 1 x #0 | 3 x #2 | 1 x #0 | 2 x #3
Row #2: | 1 x #3 | 1 x #0 | 1 x #2 | 3 x #1 | 1 x #2 | 2 x #0 | 1 x #2 | 3 x #1 | 1 x #2 | 1 x #0 | 1 x #3
Row #3: | 1 x #0 | 1 x #2 | 5 x #1 | 2 x #2 | 5 x #1 | 1 x #2 | 1 x #0
Row #4: | 1 x #0 | 1 x #2 | 12 x #1 | 1 x #2 | 1 x #0
Row #5: | 1 x #0 | 1 x #2 | 12 x #1 | 1 x #2 | 1 x #0
Row #6: | 1 x #0 | 1 x #2 | 12 x #1 | 1 x #2 | 1 x #0
Row #7: | 1 x #3 | 1 x #0 | 1 x #2 | 10 x #1 | 1 x #2 | 1 x #0 | 1 x #3
Row #8: | 2 x #3 | 1 x #0 | 1 x #2 | 8 x #1 | 1 x #2 | 1 x #0 | 2 x #3
Row #9: | 3 x #3 | 1 x #0 | 1 x #2 | 6 x #1 | 1 x #2 | 1 x #0 | 3 x #3
Row #10: | 4 x #3 | 1 x #0 | 1 x #2 | 4 x #1 | 1 x #2 | 1 x #0 | 4 x #3
Row #11: | 5 x #3 | 1 x #0 | 1 x #2 | 2 x #1 | 1 x #2 | 1 x #0 | 5 x #3
Row #12: | 6 x #3 | 1 x #0 | 2 x #2 | 1 x #0 | 6 x #3
Row #13: | 7 x #3 | 2 x #0 | 7 x #3


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 6:26 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Dec 22, 2011
Posts: 399
Ronounours wrote:
So here is a first attempt for your filter Debkl.
You should be able to find it in Testing / Ronounours / Output crochet patterns.

Attachment:
gmic_crochet.png


Let me know if you have ideas to improve it.
Here is the kind of files it generates :

Quote:
Image name: heart.png
Image size: 16x14

Number of colors: 4
Color #0: (0,0,0)
Color #1: (232,56,0)
Color #2: (248,240,168)
Color #3: (255,255,255)

Row #0: | 3 x #3 | 3 x #0 | 4 x #3 | 3 x #0 | 3 x #3
Row #1: | 2 x #3 | 1 x #0 | 3 x #2 | 1 x #0 | 2 x #3 | 1 x #0 | 3 x #2 | 1 x #0 | 2 x #3
Row #2: | 1 x #3 | 1 x #0 | 1 x #2 | 3 x #1 | 1 x #2 | 2 x #0 | 1 x #2 | 3 x #1 | 1 x #2 | 1 x #0 | 1 x #3
Row #3: | 1 x #0 | 1 x #2 | 5 x #1 | 2 x #2 | 5 x #1 | 1 x #2 | 1 x #0
Row #4: | 1 x #0 | 1 x #2 | 12 x #1 | 1 x #2 | 1 x #0
Row #5: | 1 x #0 | 1 x #2 | 12 x #1 | 1 x #2 | 1 x #0
Row #6: | 1 x #0 | 1 x #2 | 12 x #1 | 1 x #2 | 1 x #0
Row #7: | 1 x #3 | 1 x #0 | 1 x #2 | 10 x #1 | 1 x #2 | 1 x #0 | 1 x #3
Row #8: | 2 x #3 | 1 x #0 | 1 x #2 | 8 x #1 | 1 x #2 | 1 x #0 | 2 x #3
Row #9: | 3 x #3 | 1 x #0 | 1 x #2 | 6 x #1 | 1 x #2 | 1 x #0 | 3 x #3
Row #10: | 4 x #3 | 1 x #0 | 1 x #2 | 4 x #1 | 1 x #2 | 1 x #0 | 4 x #3
Row #11: | 5 x #3 | 1 x #0 | 1 x #2 | 2 x #1 | 1 x #2 | 1 x #0 | 5 x #3
Row #12: | 6 x #3 | 1 x #0 | 2 x #2 | 1 x #0 | 6 x #3
Row #13: | 7 x #3 | 2 x #0 | 7 x #3


Wow....cannot see this in Gmic...do I have to have the latest version?

_________________
Image


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 6:30 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
You need at least version 1.6.5.0 to get it :)


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 6:47 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Dec 22, 2011
Posts: 399
Ronounours wrote:
You need at least version 1.6.5.0 to get it :)

Do you mind if I PM you?

_________________
Image


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 7:31 am  (#10) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
For what it's worth, here is the output of my script.

First, the image needs to be placed within a grid where each cell represents a "stitch".

Attachment:
cinci-grid.png
cinci-grid.png [ 850 Bytes | Viewed 5201 times ]


Then when the script is run ("File->Create->Crochet Pattern by Viktoria"), the following tables are produced. Note that the direction of the stitching alternates between left-to-right and right-to-left.
Attachment:
cinci.png
cinci.png [ 127.99 KiB | Viewed 5201 times ]

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 8:13 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: Dec 22, 2011
Posts: 399
saulgoode wrote:
For what it's worth, here is the output of my script.

First, the image needs to be placed within a grid where each cell represents a "stitch".

Attachment:
cinci-grid.png


Then when the script is run ("File->Create->Crochet Pattern by Viktoria"), the following tables are produced. Note that the direction of the stitching alternates between left-to-right and right-to-left.
Attachment:
cinci.png


Its worth a great deal and I appreciate your time :)

_________________
Image


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 9:23 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Just to show where we arrived, with Deblk :)
Here are two examples HTML pages generated by the latest version of the filter :

http://gmic.eu/crochet.html

http://gmic.eu/model.html


Last edited by Ronounours on Thu Jul 09, 2015 10:03 am, edited 1 time in total.

Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 9:28 am  (#13) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
Wow, you sure put a lot of work in that one David, it is amazing. You too Saulgoode, your script is also terrific. Kudo's guys.

_________________
Image


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 10:53 am  (#14) 
Offline
GimpChat Member
User avatar

Joined: Dec 22, 2011
Posts: 399
molly wrote:
Wow, you sure put a lot of work in that one David, it is amazing. You too Saulgoode, your script is also terrific. Kudo's guys.

Yes, absolutely amazing...cannot thank them enough :)

_________________
Image


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 11:34 am  (#15) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
Hope you show us your finished project Debik. I have done one pile of crocheting in my day but never got a digital pattern before. This must be a first by our amazing coders we have here in GC.

_________________
Image


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 11:42 am  (#16) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
molly wrote:
Hope you show us your finished project Debik. I have done one pile of crocheting in my day but never got a digital pattern before. This must be a first by our amazing coders we have here in GC.


Maybe you could crochet the following pattern someday (which was designed by Viktoria Lyn):
Attachment:
saulgoode-gimp-pat.jpg
saulgoode-gimp-pat.jpg [ 101.15 KiB | Viewed 2475 times ]

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 11:51 am  (#17) 
Offline
GimpChat Member
User avatar

Joined: Dec 22, 2011
Posts: 399
molly wrote:
Hope you show us your finished project Debik. I have done one pile of crocheting in my day but never got a digital pattern before. This must be a first by our amazing coders we have here in GC.

Its what I do, create images to graph form specifically for people to crochet but some find it easier to read a graph in written form which is where I was having the problem.

It is brilliant what has been done for me and I cannot thank them enough :)

_________________
Image


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 12:24 pm  (#18) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
saulgoode wrote:
molly wrote:
Hope you show us your finished project Debik. I have done one pile of crocheting in my day but never got a digital pattern before. This must be a first by our amazing coders we have here in GC.


Maybe you could crochet the following pattern someday (which was designed by Viktoria Lyn):
Attachment:
saulgoode-gimp-pat.jpg


This would make a nice counted cross stitch pattern too Saul.

_________________
Image


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 3:05 pm  (#19) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Some new improvements for this filter.

You can now precisely set the orientation you want to follow when rendering the image, as well as the main working axis (columns or rows).
The web page generated has been also improved. An example can be found here :

http://gmic.eu/model.html

What do you think ? Is there any other improvements to do ?


Top
 Post subject: Re: Writing a script
PostPosted: Thu Jul 09, 2015 6:39 pm  (#20) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12811
Here's an old Script-fu that creates such patterns as well. Still cool that David implemented such a system in G'MIC. :)

http://registry.gimp.org/node/24421

_________________
Lyle

Psalm 109:8

Image


Top
Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group