Showing posts with label stitch in time. Show all posts
Showing posts with label stitch in time. Show all posts

Sunday, 15 June 2008

It's been a long time ...

... since I rock and rolled.

Yes, it's been a while since I last posted an entry, but that's not to say I've not been doing anything!


knitonthenet - Pattern Search


I've just completed some further enhancements to the knitonthenet site. The main noticeable difference from a visitors point of view is that there is now a pattern search page that allows a simple text search to be performed on the complete list of patterns on the site. It uses code based upon the pattern index creation php functions, that pull all the required information on each of the pattern pages from the current and previous issues, and builds them into a set of arrays. Each element is searched, and if the a match is found the data is built into another set of 'result' arrays and output to the browser. The final 'result' arrays can be ordered in the same way as they can on the Pattern Index page to display the results in a sorted order by Issue, Title, Category, or Designer. The text search is limited to the pattern title, the designer name, any description text, and the category text.

The Pattern Search should really be tagged as being a 'beta release' at this time, as it's not had much testing yet, certainly not by any real users.

A Stitch in Time

I've been doing some more work of late on 'A Stitch In Time'. And as a result of actually working on the book, I been making further additions to !-Trim which is the software application I've been writing to process and manipulate the page data of the original scanned images. It's had rather a lot of changes and additions of late, including the ability to convert the cropped images to JPEGs (well JFIFs) which are then embedded into the Drawfile output. The JPEG images are handled more efficiently in the PostScript output, which make a huge difference in processing time and file sizes when the pages are processed on the RIP. The only downside of converting the images to JPEGs in the Drawfile, is that they no longer contain any transparency (alpha channel) data that may have been present in the RISC OS Sprite file. The transparency data is added to the cropped Sprite when the cropped area needs to be an irregular shape (i.e. not rectangular). So, when converting to a JPEG the unwanted background area is painted in white. This does cause a problem for any transparent areas that overlap other cropped areas on the page as the white background will now obscure the underlying image, so the shape of the irregular frame is also output to the Drawfile as a hidden vector path (hidden as it has no fill or line colour). This path object can then be used to create a 'clipping path' to the JPEG image, thus re-creating an irregular shaped image again. The only problem is that !Draw doesn't have any concept of clipping paths, so the Drawfile will have to be imported into ArtWorks so a ClipView object can be created from the path and the JPEG.

Linux distros - a change

I'd recently been using Ubuntu on one of my PCs, but when the computer decided to pack-up (which I still need to investigate properly, but I suspect a static shock has killed the motherboard) I attempted to install onto another machine. I decided to use a machine which I'd built as a NAS (network attached storage) device, and had been testing FreeNAS, the plan being that after sufficient trials it would be deployed at work. I had, what seemed like, endless trouble trying to get Ubuntu to install and ended up installing Madriva 2008 Spring instead, as it was  included on a DVD that came with LINUX magazine. So far I'm happy with Mandriva and will be sticking with it. I think the problems with the Ubuntu installation was lack of memory as this new machine only had 256MB of RAM, of which some was being shared by the onboard graphics chip. I've since installed another 256MB simm and a separate AGP graphics card and everything seems to run very smoothly. I suppose I could re-install Ubuntu now, but I'll stay with Mandriva now it's all set-up.

Thursday, 7 February 2008

sprite rotation

I've been doing some further work on 'A Stitch In Time', which will be re-published later this year. All the artwork, printing plates and film from the original book, which was published in the early 1970s were destroyed years ago in a fire, so all the pages are having to be recreated and processed using modern scanning and image manipulation techniques. One problem has been that the printed pages are not all straight, meaning almost all the images need to be rotated. What makes this even more labour intensive is that nearly every image requires a different amount of rotation to bring it back square.



So needing something to make the job easier, I decided to write SpriteRotate - a RISC OS software application that will allow a Sprite[1] to be visually rotated in steps of 100th of a degree.



When first loaded, the image is scaled to fit the window but it can be viewed at any size required. A grid can be displayed over the rotated image to ensure that the image is correctly rotated square, and the grid position can be shifted if needed. Once the required angle is acheived a click on the 'Create Sprite' button will save a new sprite file of the rotated image.



When a new straightened image has been produced, it can then be loaded into another of my applications that allows different regions of a single image to be defined and cut into pieces. This effectively chops the large single scanned image into a number of smaller parts, each kept in the correct position in relation to the original. This is then saved as a Drawfile, which is a vector based graphics file format, that can also contain sprites. Above all, this allows large areas of white space to be removed from a page and cut down the memory and disc space requirements - making faster processing, printing, ripping screen redraws etc.



[1] A Sprite is the native bitmap image format used on the RISC OS operating system.