A New Chart Making Program. Update 21 Feb 2018

For all topics which do not fit in the other categories.

Moderators: rcperryls, Rose, karen4bells, Serinde, Alex

Post Reply
User avatar
richardandtracy
Posts: 5447
Joined: Wed May 28, 2014 4:27 pm
Location: Kent, UK
Contact:

Re: A New Chart Making Program (now with blending)

Post by richardandtracy »

Rose,

When it comes to programming, the copyright rests with the person who writes the code.
Absolutely 100% of the source code used in the program is of my origin - though I do mention a single exception below that enables the program to open .gif files.

Jari Haurito (author or Ryijy Stitch Designer) did publish his code, but as it's for a different compiler in a slightly different language (MS Visual C#), it won't work in mine (Borland C++ Builder). He is also a professional programmer, and I have absolutely no idea how his code works - I simply don't understand it, which makes it impossible to use the code. Where we did exchange code, it was from me to him to show how to print out a multi page chart.

The way this chart program started was my dissatisfaction with the way Jari's program tried to print a chart on one page regardless of the chart size. It meant that to get a readable chart with a 200 stitch high image, I had to print it on the A0 plotter at work. That was utterly ridiculous. So, after I noticed his program could save the converted image, I wrote my completely separate program to open the image and print the chart from the converted image. At that point I contacted Jari, and humbly offered my program to be bundled with his, so it could be used to extend the capability of his program. Instead, he asked how I broke the image up into separate pages for the printout, I described the process to him and sent my source code too. That obviously inspired him, and his program now has the capability to print a large chart on more than one sheet - he could no more use my code than I can use his, but the method I used must have been understandable to him.

Since August 2014 I have been busy programming, and came up with my own method of selecting a thread colour based on the image pixel colour, and at the prompting of other members here, have added capabilities like blending and dithering to the program, having taught myself these concepts from scratch by reference to Wikipedia and other online sources. I have not cribbed any code from anyone, as my compiler was out of date in the year 2000, so is not mentioned a lot in code samples, and most of the ones I can find are irrelevant. To open Gif files I did find a BCB4 library plugin on the web that takes advantage of the expiry of CompuServe's patent. This is available under the GNU GPL licence, and additionally permits me to charge for programs compiled using the plugin should I so desire. I make no claim of source code origin with reference to this plugin.

In conclusion, Rose, there is zero material in the program (apart from the one item mentioned above) that is subject to someone else's copyright. I am at liberty to distribute the program for free, or charge for it, as I see fit, as I am the copyright holder for the compiled program. I am offering it for free to give back something to a community that has given me so much in terms of knowledge & friendliness.

Regards,

Richard.
http://www.chestnutpens.co.uk
Free Charting Program for PC's Info Zip Installation
User avatar
Rose
Posts: 34059
Joined: Sun Mar 05, 2006 12:24 am
Location: Gilroy, CA

Re: A New Chart Making Program (now with blending)

Post by Rose »

Thank you Richard for the explanation. I was being careful with our forum and am happy that you are able to give this as a free program and that it works for those that need it. We ( mostly I) get a bit worried about copyrights as we have had our troubles over the years. I wanted to be as diligent with this as with any other copyright or intellectual property!
If you are looking for some one to help change you, look in the mirror
User avatar
richardandtracy
Posts: 5447
Joined: Wed May 28, 2014 4:27 pm
Location: Kent, UK
Contact:

Re: A New Chart Making Program (now with blending)

Post by richardandtracy »

I have uploaded a new version with 600 symbols programmed in. Hopefully everyone should be able to find enough symbols within that number to be able to have a range they are satisfied with that is big enough to cover any reasonable chart they're likely to convert. I could go mad and program in thousands of symbols for the most complex possible charts, but I do think 600 symbols should be enough. If it isn't, possibly you need to speak to someone wearing a white coat.

Zip file is here http://www.chestnutpens.co.uk/downloads/crossstitch.zip

The help file gives a cross reference list of all the symbols available, which is repeated below:
Image
For a bigger view, download the image from here (download it, because the photobucket view of the image is no better than the forum view):
http://s771.photobucket.com/user/richar ... b.gif.html

Regards,

Richard.
http://www.chestnutpens.co.uk
Free Charting Program for PC's Info Zip Installation
User avatar
Mabel Figworthy
Posts: 33034
Joined: Fri Mar 07, 2008 4:05 pm
Location: Dunchurch, UK
Contact:

Re: A New Chart Making Program (now with blending)

Post by Mabel Figworthy »

:shock: :shock: :shock: :shock:

That's a LOT of symbols! I think you're right in your assessment of anyone who feels 600 symbols aren't enough :-)
Visit Mabel's Fancies at www.mabelfigworthy.co.uk
WIPs
Elizabethan Beauty, RSN Certificate & Online
Waiting
Soli Deo Gloria, Mechthild, bling unicorn, goldwork & silk shading kits

Flights of Fancy (blog)
Mabel's FB page
User avatar
rcperryls
Posts: 32991
Joined: Tue Mar 22, 2011 1:36 pm
Location: SC, USA

Re: A New Chart Making Program (now with blending)

Post by rcperryls »

Mabel Figworthy wrote::shock: :shock: :shock: :shock:

That's a LOT of symbols! I think you're right in your assessment of anyone who feels 600 symbols aren't enough :-)
Might have to throw in a padded cell if 600 symbols don't do the job :P

Carole
:tizzy:
WIPs
Star Wars Afghan:Chewbaca
HAEDs:
O Kitten Tree
Dancing with the Cat
Everything else "on hold"
2022 Finished: Star Wars Afghan: Princess Leia, Obi-Wan Kenobi, Yoda, Finn, Rey, Poe, Han Solo,Darth Vader, BB8,Luke Skywalker
User avatar
Brekkana
Posts: 439
Joined: Thu Jan 08, 2015 8:32 pm

Re: A New Chart Making Program (now with blending)

Post by Brekkana »

rcperryls wrote:
Mabel Figworthy wrote::shock: :shock: :shock: :shock:

That's a LOT of symbols! I think you're right in your assessment of anyone who feels 600 symbols aren't enough :-)
Might have to throw in a padded cell if 600 symbols don't do the job :P

Carole
:tizzy:
Wow. 600. That is quite a bit of floss just to imagine someone wanting 600 different colors in a single project ... and I thought having 100 was a lot ...
So many HAEDs I couldn't possibly list them all. Current favorites are Dragon Kin, Sea Unicorns (QS), April Fairy, What's This, Dahlia, and so many starts going on. Love to cross stitch! Find me on Facebook, https://www.facebook.com/brekkana.kultiras
User avatar
richardandtracy
Posts: 5447
Joined: Wed May 28, 2014 4:27 pm
Location: Kent, UK
Contact:

Re: A New Chart Making Program (now with blending)

Post by richardandtracy »

The number of symbols is really so that someone can pick their own from a wide range of available symbols. The re-numbering process is a bit of a faff, so I don't expect many people to do it, but the facility is there.

As for large numbers of colours, there is one SAL by Gobelinkit (I think) with 216. The one I'm currently working on is 118 + fabric, and there is a chance my next project will be a mini at 184 x 48 to test blending, will have 151 thread colours (though they only make 119 blends & solids). If I do decide to do it, and get permission (not sought it yet, as I've not decided) the picture will be of a pair of the most remarkable eyes I know of:
Image

Regards,

Richard.
Last edited by richardandtracy on Wed Jul 19, 2017 9:00 am, edited 1 time in total.
http://www.chestnutpens.co.uk
Free Charting Program for PC's Info Zip Installation
User avatar
Mabel Figworthy
Posts: 33034
Joined: Fri Mar 07, 2008 4:05 pm
Location: Dunchurch, UK
Contact:

Re: A New Chart Making Program (now with blending)

Post by Mabel Figworthy »

Those eyes will be intriguing to stitch!
Visit Mabel's Fancies at www.mabelfigworthy.co.uk
WIPs
Elizabethan Beauty, RSN Certificate & Online
Waiting
Soli Deo Gloria, Mechthild, bling unicorn, goldwork & silk shading kits

Flights of Fancy (blog)
Mabel's FB page
User avatar
cairee
Posts: 956
Joined: Sun Mar 10, 2013 4:33 pm
Location: BC Canada

Re: A New Chart Making Program (now with blending)

Post by cairee »

I designed one that has 441 colors, no blends. yep just 13 colors shy of the whole set of dmc. I got the artists permission, and the chart is tweeked to perfection but I havent bought the threads and fabric yet, Im a bit worried its too much.

so yes I think 600 should satisfy even the insane.
:wip:
Mables 2016 SAL
Holland Springtime Mandalla (chatelaine)
User avatar
Brekkana
Posts: 439
Joined: Thu Jan 08, 2015 8:32 pm

Re: A New Chart Making Program (now with blending)

Post by Brekkana »

cairee wrote:I designed one that has 441 colors, no blends. yep just 13 colors shy of the whole set of dmc. I got the artists permission, and the chart is tweeked to perfection but I havent bought the threads and fabric yet, Im a bit worried its too much.

so yes I think 600 should satisfy even the insane.
I would love to see that picture :)
So many HAEDs I couldn't possibly list them all. Current favorites are Dragon Kin, Sea Unicorns (QS), April Fairy, What's This, Dahlia, and so many starts going on. Love to cross stitch! Find me on Facebook, https://www.facebook.com/brekkana.kultiras
User avatar
richardandtracy
Posts: 5447
Joined: Wed May 28, 2014 4:27 pm
Location: Kent, UK
Contact:

Re: A New Chart Making Program (now with blending)

Post by richardandtracy »

Brekkana wrote:
cairee wrote:I designed one that has 441 colors, no blends. ...
I would love to see that picture :)
Absolutely!
At the moment, as far as I can tell with recent removals of some colours (well, within the last 10 years), there are 448 colours, so 441 is 7 short, not 13 short. Gulp!

Regards,

Richard
http://www.chestnutpens.co.uk
Free Charting Program for PC's Info Zip Installation
User avatar
rcperryls
Posts: 32991
Joined: Tue Mar 22, 2011 1:36 pm
Location: SC, USA

Re: A New Chart Making Program (now with blending)

Post by rcperryls »

richardandtracy wrote:
Brekkana wrote:
cairee wrote:I designed one that has 441 colors, no blends. ...
I would love to see that picture :)
Absolutely!
At the moment, as far as I can tell with recent removals of some colours (well, within the last 10 years), there are 448 colours, so 441 is 7 short, not 13 short. Gulp!

Regards,

Richard
:shock:

Carole
:shock:
WIPs
Star Wars Afghan:Chewbaca
HAEDs:
O Kitten Tree
Dancing with the Cat
Everything else "on hold"
2022 Finished: Star Wars Afghan: Princess Leia, Obi-Wan Kenobi, Yoda, Finn, Rey, Poe, Han Solo,Darth Vader, BB8,Luke Skywalker
User avatar
richardandtracy
Posts: 5447
Joined: Wed May 28, 2014 4:27 pm
Location: Kent, UK
Contact:

Re: A New Chart Making Program (now with blending)

Post by richardandtracy »

I am adding an image editor to the program so it can be used to edit existing images or to create images from scratch. The editor uses two palettes, the standard thread colours from DMC and blended threads. It creates vector graphics components that lie above the existing bitmap. These objects can be edited, shuffled, moved & copied until such time as you are satisfied with the result and return to the chart program, when the objects are incorporated into the chart image.

The objects can be a pencil tool, line, flood fill, eyedropper, text, filled rectangles, filled ellipses/circles, 3 line widths (1,2 or 4 stitches), erase tools (to punch a hole through everything to the chart image behind) and blocks.

At the moment it looks as below with a simple image created very quickly in the program:
Image
To the left are the tools, to the right are the pallets and the image screen is shown at roughly 100% stitch size when the zoom is 100%.
The turquoise zigzag shows the 3 line thicknesses, the rectangle has an erase object cut through it, The pinky-purple blob to the top right shows a closed freeform pencil object with a flood fill. The text in the middle is pretty obvious, and the odd facelike repeat at the bottom is a block. The master block is surrounded by a red rectangle, and all blocks linked to it are outlined in green. The intention is that it should be possible to edit one of the linked blocks and they'll all change. The rectangles around the blocks and links are not part of the stitching.

The grey bands above and to the left of the image will be rulers when I can get around to it.

Now, I have a few questions as to further ideas people would like to be incorporated.
  1. Is it worthwhile having text that can be rotated? And what divisions? In theory the text could be rotated in 0.1 degree increments, but I think 90 degrees would be better.
  2. Is a poly line worth incorporating?
  3. Is a filled polyline worth incorporating?
  4. How useful would you find the ability to mirror and/or rotate an object?
Your input will be greatly appreciated.

Regards,

Richard.
http://www.chestnutpens.co.uk
Free Charting Program for PC's Info Zip Installation
User avatar
Allyn
Posts: 2226
Joined: Sat Mar 30, 2013 4:57 pm
Location: Mississippi Gulf Coast
Contact:

Re: A New Chart Making Program (now with blending)

Post by Allyn »

richardandtracy wrote:
  1. Is it worthwhile having text that can be rotated? And what divisions? In theory the text could be rotated in 0.1 degree increments, but I think 90 degrees would be better.
  2. Is a poly line worth incorporating?
  3. Is a filled polyline worth incorporating?
  4. How useful would you find the ability to mirror and/or rotate an object?
Here are my thoughts:
1. The user should be able to rotate text at any angle they need, not just limited to 90 degrees. Once text is added, could it be rotated as an object? (see #4)
2. Yes
3. Yes
4. Invaluable
_________________________________________________________

WIP
Image
User avatar
richardandtracy
Posts: 5447
Joined: Wed May 28, 2014 4:27 pm
Location: Kent, UK
Contact:

Re: A New Chart Making Program (Image Editor Questions)

Post by richardandtracy »

Thanks for your input Allyn. I'll see what I can do.

I think, with text it may be easier to rotate it within the object using a 'LogFont' or logical font where Windows selects the pixels to be highlighted after creating a temporary font in memory at the right angle. I have yet to explore this feature, and will be using it anyway for the side ruler.

I have some concerns about rotation of objects through non integer multiples of 90 degrees needing to be anti-aliased to make them look right. As a result, the number of thread colours could rapidly get completely out of hand if the program were to select the best possible match for the anti-aliased pixels - especially if the 11000 blended colours are included too. I have a strong feeling that simple functions would reduce the programming effort (of some slight importance to me, if no-one else!), make the features easier to use (quite high importance) and keep thread colour numbers in check (moderate importance). As far as I can see, the features I'm offering already exceed the drawing features of PCStitch 10 (or at least the demo version I have), with the exception of mirroring.

Regards,

Richard
http://www.chestnutpens.co.uk
Free Charting Program for PC's Info Zip Installation
User avatar
NeedleAndFork
Posts: 980
Joined: Tue Apr 09, 2013 5:05 am

Re: A New Chart Making Program (Image Editor Questions)

Post by NeedleAndFork »

Wow, even more enhancements!

I'm going to echo Allyn and say yes to all your questions as well. Text rotation would have saved me HOURS this past week if I'd had the ability - I had to rechart some text on a 30 degree angle and oh dear god the madness it drove me to! I can seewhere the anti aliasing could cause a problem with rotating it though since you're taking the clean lines of a font and putting them at all sorts of angles. I imagine being able to set some number of levels for it would have to be implemented. Ideally I'd love free rotation to any angle I like, but if that's not possible I'd say rotations in multiples of 45 degree angles and multiples of 30 degree angles would be most useful.

I really like what you're doing with the linked blocks and I can see it coming in very useful, especially if blocks can then be rotated or flipped. It would make it easy to repeat elements in a geometric design and make changes just once in the master block and have it carry through to the whole design. That concept is used some in various graphic programs and comes in very handy at times.

I'm FINALLY finished with my comissioned stitching piece and am picking up my HAED again.. and at the same time, starting ot think about my next project. I've got a whole folder of images I like that I want to play with your program and see how they turn out - they're images that traditionally wouldn't convert well.. night time skyscapes with the milky way visible for example.. If there's any software out there capable of charting images like that though, I think it's yours.
My blog: Obsessed With Thread

My WIPs: Kimono Lantern Mermaid, Rovaris Alphabet Sampler Christmas Ornaments

Participant of: Ornament a Month SAL, Stitch from Stash Challenge
User avatar
richardandtracy
Posts: 5447
Joined: Wed May 28, 2014 4:27 pm
Location: Kent, UK
Contact:

Re: A New Chart Making Program (Image Editor Questions)

Post by richardandtracy »

OK, I might as well go the whole 9 yards.

It will delay the point at which I can release it a bit, particularly as I work out how to do the anti-aliasing.

Regards,

Richard.
http://www.chestnutpens.co.uk
Free Charting Program for PC's Info Zip Installation
User avatar
richardandtracy
Posts: 5447
Joined: Wed May 28, 2014 4:27 pm
Location: Kent, UK
Contact:

Re: A New Chart Making Program (Image Editor Questions)

Post by richardandtracy »

After having a moderately restless night because of the answers above (brain wouldn't switch off, similar to having too much tea), I think I have an idea of the way forward.

I will offer 3 levels of anti-aliasing.
  1. None.
  2. DMC plain thread colour matching only.
  3. Blended colour matching too.
On the rotation, the user will click on a centre point, and then click on a second point to get the angle. The Shift Key will limit the angle of rotation to multiples of 15 degrees (simpler than trying to detect 0,30, 45, 60 & 90).

On mirroring, the user will select 2 points for the mirror line, and the shift key will limit the angle of the mirror line as for rotation.

I will have to totally re-jig the program to include a sensibly thought through undo strategy. At the moment the 'undo' consists of deleting the topmost entry in the display order - which is totally unable to cope with the idea of rotation or mirroring. I had kludged it a bit with moving, by copying the old entity and making the original invisible, but was unhappy about it because it couldn't automatically reverse itself. The new strategy will consist of a series of commands in a string list like:
  • rotate,42,-30,10,60
This would be the undo command to a rotation of display item 42 through 30 degrees about X10, Y60. I have done this idea to a much greater extent on a 3D finite element modeller, where every command is recorded in a session file and its opposite is recorded in the undo file, then a command interpreter is used to read either file or keyboard input (like found in AutoCAD) to interpret the commands. The interpreter on that one is 15000 lines of code and deals with about 600 different commands.

I have a feeling there will be a lot of work to re-jig, as well as a lot of new stuff. Proper planning at the beginning would have helped! Oh, and not asking for comments from a group who put the highest demands I know of on their software. Hrrumph. However, if you are going to do something, might as well try to do it properly.

Regards,

Richard
http://www.chestnutpens.co.uk
Free Charting Program for PC's Info Zip Installation
User avatar
richardandtracy
Posts: 5447
Joined: Wed May 28, 2014 4:27 pm
Location: Kent, UK
Contact:

Re: A New Chart Making Program (Image Editor Questions)

Post by richardandtracy »

Hmm.

I have run into a slight problem.
I thought lines and rectangles drawn using the Windows Win32GDI commands were anti-aliased. Turns out I was wrong.
This does make things a little more difficult, as I'll have to teach myself how to do it, then program it.

Ah well. Did the same with dithering. Just took a while.

Fortunately Text is anti-aliased.

Other progress:
I have now nearly got the 'Undo' kludges fixed. I shall next go onto rotating the existing entities before adding new ones (polyline & filled polyline) or anti-aliasing anything other than text. That way, hopefully, I'll be able to release a useful program earlier than I might otherwise be able to.
With blocks, I'm going to add the feature for some of the pixels in the block to be transparent, which may be useful.

Regards,

Richard.

Edited to add:
I have seen an idea on the web which should make anti-aliasing very simple if I can implement it. Basically draw a copy of the image to memory at 4x or 8x scale, then copy it to the image at the same time as scaling it down by 4x or 8x. Then windows does all the anti-aliasing as it shrinks the picture. Clever idea, wish I had thought of it.
Edited again to say:
Wish it worked, because it doesn't seem to!
http://www.chestnutpens.co.uk
Free Charting Program for PC's Info Zip Installation
User avatar
richardandtracy
Posts: 5447
Joined: Wed May 28, 2014 4:27 pm
Location: Kent, UK
Contact:

Re: A New Chart Making Program (Image Editor Questions)

Post by richardandtracy »

Hmm.
I tried the brute ignorance & force method of image size reduction (in other words, I programmed it, pixel by pixel), and it seems to have worked, giving the following Anti-Aliased (upper) and non anti-aliased (lower) comparison:
Image

It is slow at the moment. Really slow. But hopefully it'll work.

Regards,

Richard.
http://www.chestnutpens.co.uk
Free Charting Program for PC's Info Zip Installation
Post Reply