tag:blogger.com,1999:blog-89645837524169453832024-03-14T01:07:03.087+02:00Filter Effects DeveloperWritings and tutorials on Filter Effects in <a href="http://inkscape.org/">Inkscape</a> — and sometimes other stuff in field of graphics and open source.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.comBlogger52125tag:blogger.com,1999:blog-8964583752416945383.post-35184995650983352922013-01-26T20:47:00.000+02:002013-01-26T20:48:09.389+02:00Them catsI have read quite a bit of web comics lately. A couple nice ones are <a href="http://www.lackadaisycats.com/">Lackadaisy</a> and <a href="http://www.bittersweetcandybowl.com/">Bittersweet Candy Bowl</a>. Lackadaisy is a superbly drawn comic about a speakeasy called Lackadaisy and the folks running that place in 1920's during the prohibition. Bittersweet Candy Bowl in turn is a comic about high school teenagers who have in between them a bunch of one-way – and sometimes two-way – love relationships, and drama ensues.<br />
<br />
These two don't have much in common, except that in both the main characters are cats. The Lackadaisy world is run by cats only, whereas BCB world is run by both cats and dogs and has bunch of other talking animals as well.<br />
<br />
Nevertheless, the idea I had was: what if the folks from these two worlds came across each other? Never mind that they are from quite different eras or that the other cats walk around mostly naked and the others tend to be fully and stylishly dressed.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvaXYl7v3rXKaQmCMNQkV0ZoSjs69b86YUCuTrug2QQoj01k4BfBrG8FAKoAAvaAQU4_VmW7YPBhIrBjKhUC2AozlK78lBKl4nHDVXPhkm__mScHO0Wqnk1J8oZifia7CUAVkhjBMDOJoo/s1600/charleston.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="232" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvaXYl7v3rXKaQmCMNQkV0ZoSjs69b86YUCuTrug2QQoj01k4BfBrG8FAKoAAvaAQU4_VmW7YPBhIrBjKhUC2AozlK78lBKl4nHDVXPhkm__mScHO0Wqnk1J8oZifia7CUAVkhjBMDOJoo/s320/charleston.jpg" width="320" /></a></div>
This would happen. Sooner or later.<br />
<br />
The boy cat in comfy blue scarf is Mike from Bittersweet Candy Bowl. The lady cat in lovely orange dress is the ever chipper Ivy Pepper from Lackadaisy. The tools used are, as usual, ProMarker colored markers and Fine Liner black pens on marker-proof paper, all from <a href="http://www.letraset.com/shopaff.asp?affid=42">Letraset</a>.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com0tag:blogger.com,1999:blog-8964583752416945383.post-6897763151157132682012-10-17T20:43:00.000+03:002012-10-18T07:37:26.848+03:00Review: Inkscape Beginner's Guide<a href="http://www.packtpub.com/">Packt Publishing</a> has published a book called <a href="http://www.packtpub.com/inkscape-to-create-attractive-layout-designs-logos-brochures-icons-beginners-guide/book">Inkscape Beginner's Guide</a>. I've had the chance to read this book and here I will share my thoughts about this book. I don't really belong to the people this book it targeted to – Inkscape beginners – but I have tried to look at this book as if I was not fluent Inkscape user already.<br />
<br />
In brief, this book explores a wide variety of features available in Inkscape 0.48 in a straightforward and easy-to-follow way. Copious amounts of screen shots are used so that it is easy to see what kind of results one should expect when trying out the features described in the book. Naturally, the flip side of this is that none of the features are discussed in depth – the book would become huge if they were.<br />
<br />
The book starts from the very beginnings, such as what are vector graphics, SVG and Inkscape and how to install Inkscape. In fact, it is not until chapter 4 that the reader is shown how to draw something. If I was writing a beginner's guide I probably would get into the drawing part earlier on, but how this book is written has its merits too: the basics are explained before the things that build upon them.<br />
<br />
The target audience of the book seems to be aspiring print or web designers. Before drawing their first shape, the reader is shown how to define the page size and how to set up the different margins used in print design. Many of the examples show web page design tasks and there are several mentions of things "your programming team" can do, such as programmatically modifying the SVG file you have created.<br />
<br />
Unfortunately the book has a slight unfinished feeling to it. Nothing big, for example the first chapter tells SVG is based on XML on multiple occasions, but never really tells what is XML. An other part of book shows how to change the page background opacity by changing the hexadecimal colour code from <span style="font-family: "Courier New",Courier,monospace;">ffffff00</span> to <span style="font-family: "Courier New",Courier,monospace;">ffffffff</span> without telling what those codes mean and when the alpha slider is clearly visible in the provided screen shot. One chapter declares it will show how to use <a href="http://levien.com/spiro/">spiros</a>, but shows spirals instead. Small things and a beginner would not even notice most, just multiple things that feel slightly odd.<br />
<br />
One big thing I would change is the way how the Bezier tool is presented in the book, though this is really mostly a personal preference. Anyhow, it is a tool that I use often and make heavy use of its short cuts, but the book only shows how to draw straight lines with sharp corners and how they can be turned into round lines and corners afterwards. If I was doing my drawing the way it is shown in this book, it would take a lot more time. This is a general trend in the book elsewhere, too: it shows things you can do with Inkscape, but often not how to do them efficiently.<br />
<br />
Not so much about the book contents, but I do like how the e-book is made. I got myself the PDF version and it looks well made and does come with full index. If I want to jump to, say, chapter 9 which explains filter effects, I can just select it from the side bar in Evince (or other PDF reader). Only issue I have with it is that my name appears on every page of the PDF – obviously it is there to combat piracy, but it also causes a mental highlight fairly often when you spot your own name on the document.<br />
<br />
So, to recap: this book gives a wide overview of how to use Inkscape, but somewhat lacks in depth. I would believe this book can be useful for beginners – just as its title says – but not so much for anyone who already knows his way around Inkscape. Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com0tag:blogger.com,1999:blog-8964583752416945383.post-76186128232410281122012-09-16T12:56:00.000+03:002012-09-16T12:56:33.758+03:00Neon MarkersThe folks at Letraset were kind enough to send me a sample pack of their new <a href="http://www.letraset.com/shopaff.asp?affid=42&id=4756">Neon Markers</a>. I tried them out and I feel they are quality items, though maybe limited to some special purposes.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8QKeovUO8FucHdMtxbdgxrNdaIJgaQ-EwTCIJnZiSB_OmPsnpYDvIN9XfodM7yrVltV9XJhXzd-hyTKbwHpQKGdRioATTaDW0KEK882LNhOM7w6DtuYvxLMIV6fUKu4cpzzraf7pc9fFo/s1600/neonmarker-1.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="224" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8QKeovUO8FucHdMtxbdgxrNdaIJgaQ-EwTCIJnZiSB_OmPsnpYDvIN9XfodM7yrVltV9XJhXzd-hyTKbwHpQKGdRioATTaDW0KEK882LNhOM7w6DtuYvxLMIV6fUKu4cpzzraf7pc9fFo/s320/neonmarker-1.jpeg" width="320" /></a></div>
<br />
Basically, the Neon Markers are artistic markers with fluorescent inks. The construction will be very familiar to anyone who has used <a href="http://www.letraset.com/shopaff.asp?affid=42&directurl=/products/8-ProMarkers">ProMarkers</a> from Letraset. Only discernible difference is that ProMarkers have small bullet tip on one end and larger chisel tip on the other, whereas Neon Markers have a bullet tip on both ends, one small and other larger.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLnfwFrJiCV4gyBk4bgJsJ0nH8D5qDwclyA_dqjgApgJ1a4LK4i-6mhm6E1-4cyzyLBtxj7wBBLytYregfxo3blRnhJ82ZYGsk16cdqD9EYi0Z9YEOA3SWtEHUYxOGv_cfpfZqWWnZggum/s1600/neonmarker-2.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="158" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLnfwFrJiCV4gyBk4bgJsJ0nH8D5qDwclyA_dqjgApgJ1a4LK4i-6mhm6E1-4cyzyLBtxj7wBBLytYregfxo3blRnhJ82ZYGsk16cdqD9EYi0Z9YEOA3SWtEHUYxOGv_cfpfZqWWnZggum/s320/neonmarker-2.jpeg" width="320" /></a></div>
<br />
The idea of fluorescent colours is that the colour appears impossibly bright, as if it was reflecting more light than there is. In fact, the colour is taking in light of a high frequency, such as ultraviolet light, and emitting it on lower frequency, such as yellow light.<br />
<br />
The fact that Neon Marker colours react to ultraviolet light makes them especially attractive to situations where there's plenty of such light present. These colours will literally shine in places illuminated with little ordinary light and several blacklight bulbs.<br />
<br />
Many of you may have already noticed that this fluorescent property is nothing new: in fact the common highlighter pens contain similar ink. I tried some highlighter pens I have and compared them to these Neon Markers. The colours hues are really similar to each other, but the colours of Neon Markers are clearly more saturated and vibrant than the colours of highlighters.<br />
<br />
Here are the Neon Marker colours with some similar colours from the ProMarker range. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioRjNpzKfex7d1kcEaj6zxMyUD4KUVol2KprBdsr3aWRDXd52-v43KfvPn459NGlqan4fuGK6M2xk0YJQtG2TFGqJ2WIAMCGBvcWc2yU3GHJ-8qHskdT5yB2dWr_XcpDVxruEcvpY1bfqX/s1600/neonmarker-3.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioRjNpzKfex7d1kcEaj6zxMyUD4KUVol2KprBdsr3aWRDXd52-v43KfvPn459NGlqan4fuGK6M2xk0YJQtG2TFGqJ2WIAMCGBvcWc2yU3GHJ-8qHskdT5yB2dWr_XcpDVxruEcvpY1bfqX/s320/neonmarker-3.jpeg" width="246" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
The Neon Marker colours in this picture are not too distinctive
from what you can achieve with normal marker colours, except for <i>luminous yellow</i> and maybe for <i>radiant orange</i>.
In the real life the differences were more visible, but the limited
capabilities of the camera and computer monitors dull out the colours.
So, if your target is to make something that will be shown on computer
screen, the Neon Markers are so-so. Photocopying or ordinary four-colour
printing will likely bump into same issue.<br />
<br />
Here are the same colours when illuminated with a small ultraviolet torch.
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6PjLQBR4Q1_DaSCp3XEmEEQzDwfxCpDQodOrfUx5qPmAqaGQzlvayz5qJwA1nN8x17RbERPrC5edLWBECv9wwSqE6gjHPyAIVTZcykTKSvvkLGPbR0q__ix1AGNp0M8cBb_OvVxvghhco/s1600/neonmarker-4.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6PjLQBR4Q1_DaSCp3XEmEEQzDwfxCpDQodOrfUx5qPmAqaGQzlvayz5qJwA1nN8x17RbERPrC5edLWBECv9wwSqE6gjHPyAIVTZcykTKSvvkLGPbR0q__ix1AGNp0M8cBb_OvVxvghhco/s320/neonmarker-4.jpeg" width="244" /></a></div>
In ultraviolet light the Neon Markers really come to life, except for <i>volt blue</i>. That one just seems to have very little fluorescent properties and is almost the same colour as <i>sky blue</i> from ProMarker range. My camera seems to have somewhat freaked out with the colours in the picture illuminated with ultraviolet light, but you can still see the main point: the Neon Marker colours shine while other colours seem to become dull and dark in comparison to them.<br />
<br />
So, to recap: these markers are so-so when the result is reproduced on computer screen. They are a lot better when people can see the original drawing you made. And when the original drawing is displayed under ultraviolet light aka. blacklight, that's when these markers work the best.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com1tag:blogger.com,1999:blog-8964583752416945383.post-2955190274604957842012-08-01T22:57:00.001+03:002012-08-01T22:57:48.019+03:00The sound of Soundbox<div class="" style="clear: both; text-align: center;">
<div style="text-align: left;">
So, at last I managed to take some video of the Soundbox device I have built. I have discussed this device in two earlier posts, notably the <a href="http://fedev.blogspot.fi/2011/11/soundbox-what-makes-it-tick.html">electronics</a> and the <a href="http://fedev.blogspot.fi/2012/01/soundbox-construction.html">case construction</a>.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<object width="320" height="266" class="BLOGGER-picasa-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp4L_KjmSCMebJF3h__7a9djZ_dPmird10l-FnB6p2eTJ2INudf-dHqFe_gJwCkHkE1Jv-iZGEpAmH6SsoAJWPbtc65NV3R0oe-PxHZpCQVvkfUkmWsasB5rWvC1G5HvcC6K1WmGJ2eRnW/s1600/out.mpg"><param name="movie" value="http://video.google.com/googleplayer.swf?videoUrl=http://redirector.googlevideo.com/videoplayback?id%3D9cdbdeb72a29a5ac%26itag%3D5%26source%3Dpicasa%26cmo%3Dsensitive_content%253Dyes%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1346442639%26sparams%3Did,itag,source,ip,ipbits,expire%26signature%3D67D302EB476D58CCB49DB8430F49D1C62D096B6E.35D2387647A969B07B9172F92DE9E2657BE9C8EA%26key%3Dlh1" /><param name="bgcolor" value="#FFFFFF" /><param name="allowFullScreen" value="true" /><embed width="320" height="266" src="http://video.google.com/googleplayer.swf?videoUrl=http://redirector.googlevideo.com/videoplayback?id%3D9cdbdeb72a29a5ac%26itag%3D5%26source%3Dpicasa%26cmo%3Dsensitive_content%253Dyes%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1346442639%26sparams%3Did,itag,source,ip,ipbits,expire%26signature%3D67D302EB476D58CCB49DB8430F49D1C62D096B6E.35D2387647A969B07B9172F92DE9E2657BE9C8EA%26key%3Dlh1" type="application/x-shockwave-flash" allowfullscreen="true"></embed></object></div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<span id="goog_1146248173"></span><span id="goog_1146248174"></span></div>
Here I first demo the two different voices, sine and noise, separately. After that, I try to build some nice sounding loop with both voices combined. The latter part is somewhat failure, though. On a previous try of recording the video I actually managed to build a loop that sounds mostly good, but some glitch messed up the audio on that.<br />
<br />
This video had been sitting on my hard drive and Google's servers for quite a while, since at the time when I recorded it, I was unable to embed it into a post using the Blogger editor. But now, as I was writing an another post, I noticed that there were new options in the "Add image" dialog and I was able to post this video. Yay!Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com0tag:blogger.com,1999:blog-8964583752416945383.post-54066332137902799392012-08-01T22:44:00.000+03:002012-08-01T22:49:27.272+03:00My Raspberry Pi SetupI was not amongst the first to order a <a href="http://www.raspberrypi.org/">Raspberry Pi</a> so I received mine only last week. Here's a story of how I set it up and what issues I encountered on the way.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEid6oTQ_W2CFo3iltyFv0UlLQ-ygUDpWa7LQLl7q-art9qmcZlsqev6erR8-LDSY7vqk1uR4kRliKab4nJBPEkjyMfIHdyTcb6vMIz04BHsxZtJtb5Sdse6zsVmTuiQqZUgSyFTSnShz_p2/s1600/raspi-general.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="236" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEid6oTQ_W2CFo3iltyFv0UlLQ-ygUDpWa7LQLl7q-art9qmcZlsqev6erR8-LDSY7vqk1uR4kRliKab4nJBPEkjyMfIHdyTcb6vMIz04BHsxZtJtb5Sdse6zsVmTuiQqZUgSyFTSnShz_p2/s320/raspi-general.jpg" width="320" /></a></div>
This is my setup. On top centre in the Pi itself. Upwards from it goes the HDMI connection to the screen and on its right side is connected an 8 GB MicroSDHC card in an SD adapter. Below the Pi is a powered el-cheapo USB hub, to which are connected the receiver for wireless keyboard and mouse and the WLAN dongle. The USB hub also powers the Raspberry Pi. On the lower right is a 5 V 3 A power source.<br />
<br />
From the get-go I experienced issues with my setup: it was not stable, but corrupted the file system in really short order. Usually running the raspi-setup program, going through the settings and rebooting was enough to screw up the file system beyond all repair.<br />
<br />
First I tried to solve this issue by trying out a couple different OS distros, using different methods of powering the system and using minimal amount of peripherals. I tried the official <a href="http://www.raspberrypi.org/downloads">Raspbian "wheezy"</a> image, the <a href="http://www.raspbian.org/PiscesImages">Raspbian Pisces</a> image and <a href="http://openelec.tv/">OpenELEC</a>. I could get none of them work to an useful degree.<br />
<br />
Getting the power source in good shape was likely a notable part of getting the whole setup working. Originally I used a small adjustable power supply I had lying around. One issue was that the power supply heated up significantly when in use, even though it was rated for even more current than my setup consumed.<br />
<br />
The other, maybe more major, issue was that the USB hub was powering the Pi from both the power input jack and the USB output jack. If I powered the Pi from a mobile phone charger and the USB hub from the adjustable power supply, unplugging the phone charger was not enough to power the Pi off. It has been reported that this can cause file system corruption, since while the electronics can be powered from the USB output jack, the 100 mA polyfuse in its power rails prevents the electronics from receiving enough power, causing the voltage to drop under recommended levels. This voltage drop can cause the SD card to behave erratically.<br />
<br />
To prevent the USB hub from powering the Raspberry Pi through the USB output jack, I cracked the hub open and started to investigate.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3AMhoc774eug_qJCbeRpvRMKQRK2pF3XyQSRQRvBVYh7Q-fPtKan7ACuyng4DKeqUw4kvzPdq2tSu3Ls8gh05pke47bNLyrJeUjHaVqIpLw4nwJLjWR9L5vHMtjTWhDP9gaxG6cNDUeNP/s1600/raspi-hub-overview.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="207" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3AMhoc774eug_qJCbeRpvRMKQRK2pF3XyQSRQRvBVYh7Q-fPtKan7ACuyng4DKeqUw4kvzPdq2tSu3Ls8gh05pke47bNLyrJeUjHaVqIpLw4nwJLjWR9L5vHMtjTWhDP9gaxG6cNDUeNP/s320/raspi-hub-overview.jpg" width="320" /></a></div>
Very simple device. Two-part plastic enclosure is held together only by tabs moulded to the bottom part. Inside is a one-sided circuit board with the USB connectors, one electrolytic capacitor, clock crystal, 3.3 V LDO regulator, unmarked microchip containing the USB hub logic and assorted resistors and small capacitors.<br />
<br />
Here on the first picture you can see the modification I made to the hub: the USB connector to host computer is attached to the circuit board on top centre. The red and black leads of this connector, marked helpfully with letters R and B, were the leads that supplied the operating voltage from host to the board – or from board to the host. So, I cut them. Probably there was no need to cut the black lead and it would have sufficed to cut the red lead providing the +5 V connection and leave the 0 V black lead as-is, but I had already cut both leads when I realized this. Fortunately there's still the shield connection, which connects to the metal outsides of USB connectors and is likely tied to 0 V line anyhow. This modification makes this hub unusable as host-powered hub as the host can no longer power the hub or the devices connected to it, but I think I can live with that.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGqHC5_SvRcO32xhlYHyP4qTCgjj5928gTHMNgN49COmyOTpodb4RlDLIw25NzTRToZEQMvNvzk8ykYqnXU7JEzImfpE0qeexaLncucdm0vXDOyOwM6qN-WRpPAG452R9ruiW_wQAEx2wP/s1600/raspi-hub-top.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGqHC5_SvRcO32xhlYHyP4qTCgjj5928gTHMNgN49COmyOTpodb4RlDLIw25NzTRToZEQMvNvzk8ykYqnXU7JEzImfpE0qeexaLncucdm0vXDOyOwM6qN-WRpPAG452R9ruiW_wQAEx2wP/s320/raspi-hub-top.jpg" width="320" /></a></div>
No modifications were done to the underside of the board. There's one interesting thing on the right side of the main IC, though. If you look closely, you can notice an seemingly out-of-place component connecting the right legs of C15 and R3. It might be a small capacitor. Anyhow it's in a somewhat odd angle and not connected to pads of its own, like all other components are. I can't make out, if it's a stray component that has happened to lodge itself there or if it's a cluge – maybe a component that needed to be added after a massive batch of circuit boards had already been manufactured.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA9qMbnzKMT9kSInsRHhGDKIxykXpw6tSVETHh2Z-_bW4WKTTfpGiEb-56Yht04uBfeyYGSDPEFTe0TFwWhydkl7wcYyGov4fYZlA-RfQAmfgeDaNg6CB7jNGF-VUDmAxFdbvamRT9d1KC/s1600/raspi-hub-bottom.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA9qMbnzKMT9kSInsRHhGDKIxykXpw6tSVETHh2Z-_bW4WKTTfpGiEb-56Yht04uBfeyYGSDPEFTe0TFwWhydkl7wcYyGov4fYZlA-RfQAmfgeDaNg6CB7jNGF-VUDmAxFdbvamRT9d1KC/s320/raspi-hub-bottom.jpg" width="320" /></a></div>
Modifying the hub sorted out most of my power issues: now I could power the whole setup from one power source through the hub without accidentally powering the Pi through its USB outputs. The original power supply still got rather hot and I was somewhat suspicious of its capability to output stable 5 V, so I bought a small 5 V 3 A fixed-voltage switching mode power supply from Partco, a local electronic components supplier. This is plenty current capacity to drive the Pi and the peripherals I use. Nominally the Pi uses 700 mA, the WLAN adapter 500 mA and the keyboard and mouse receiver under 100 mA, so I have plenty of reserve power, should I want to connect an external hard disk drive or some such.<br />
<br />
Even with the power issues solved, the file system corruption continued. Next up on the list was the SD card itself. On the left is a Transcend 4 GB Class 6 SDHC card I had been using in my old netbook to extend its fairly small SSD disks. Even though it had served me well on other uses, this card was totally unusable with the Pi. Major file system corruption and frustration ensued. When I switched to using the 8 GB Class 4 Kingston MicroSDHC and adapter on right, everything just started to work. No more file system corruption.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtheLFfhDCKkGYwiNl2NEtee3sTjat5Qmuy7l32NHznqG88xYs0FbxTecyQl5zup2yRC7_0aezj9spFJ7ag1eeDi9Y6050J9Rn4uYzJf2CKKoImyEUOXPXG3qtNxkBUSQ9FIJwwiOa9Oo8/s1600/raspi-cards.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="315" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtheLFfhDCKkGYwiNl2NEtee3sTjat5Qmuy7l32NHznqG88xYs0FbxTecyQl5zup2yRC7_0aezj9spFJ7ag1eeDi9Y6050J9Rn4uYzJf2CKKoImyEUOXPXG3qtNxkBUSQ9FIJwwiOa9Oo8/s320/raspi-cards.jpg" width="320" /></a></div>
<br />
The markings on the back of the unusable card say "8281AB 4G 05D91" while the working card is marked "C08G" and "SDC4/8GB 56"<br />
<br />
So, after a long wait for manufacturing and shipping, some hardware modification and changing memory cards I finally managed to get my Raspberry Pi in a working state. Right now it's nothing but a low-power silent device I can use to browse the web, but maybe I'll come up with some more interesting things to do with it soon.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com0tag:blogger.com,1999:blog-8964583752416945383.post-63966680731504547452012-01-04T22:29:00.002+02:002012-01-04T22:29:59.204+02:00Soundbox — The constructionThe Soundbox device I have built uses some construction techniques I want to share with you readers. I'm mainly talking about the enclosure and the texts on controls.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-mdpq8cI1szI/TwSlwXHVKRI/AAAAAAAAAOI/aSk3MJFqypo/s1600/2012-01-04+21.04.03.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://3.bp.blogspot.com/-mdpq8cI1szI/TwSlwXHVKRI/AAAAAAAAAOI/aSk3MJFqypo/s320/2012-01-04+21.04.03.jpg" width="320" /></a></div>
<br />
The enclosure itself is built from a simple box bought from a craft
store. It was unfinished wooden box with two small hinges and a clasp to
hold it closed. The lid and bottom parts were quite nicely suitable size for all the parts, I just needed to build the control panel inside this box.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-PMFFepbV0Z0/TwSl5vNxROI/AAAAAAAAAOQ/4YulpY-AE10/s1600/2012-01-04+21.13.40.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://3.bp.blogspot.com/-PMFFepbV0Z0/TwSl5vNxROI/AAAAAAAAAOQ/4YulpY-AE10/s320/2012-01-04+21.13.40.jpg" width="320" /></a></div>
<br />
The control panel is built from 4 mm plywood that I cut to the correct shape with a coping saw (not the best tool for the job, but that was what I happened to have at hand). Then I drilled the holes for the knobs and such. The speaker hole I cut with the coping saw. To keep the control panel in place, I glued some 9 × 9 mm wood bars to the inside of the box, 4 mm from the top of the bottom box so that the control panel will sit flush with the sides of the bottom part.<br />
<br />
After constructing the box, I removed the hinges and the clasp and painted the box and control panel with several (maybe four) layers of white spray paint. What surprised me was how much that stuff stinks — I had to keep the parts outdoors for a couple days after painting so that my room would not smell of solvents. The finished box had a distinct solvent smell for like a month after it was done.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-FiQuJI8XnQg/TwSmA1s-SPI/AAAAAAAAAOY/pnIUe5TdCuM/s1600/2011-06-30+23.05.20.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://1.bp.blogspot.com/-FiQuJI8XnQg/TwSmA1s-SPI/AAAAAAAAAOY/pnIUe5TdCuM/s320/2011-06-30+23.05.20.jpg" width="320" /></a></div>
<br />
The two main knobs — pitch and arpeggio — are of my own design. They're seven-sided knobs with friction fit for the usual 6 mm potentiometer axle. I created the model in <a href="http://www.blender.org/">Blender</a> and ordered them from a 3D printing company called <a href="http://www.shapeways.com/">Shapeways</a>. The design didn't work quite as intended and I had to remove some material from underside of the knob so that the nut that holds the potentiometer in place fits under the knob. I also had to use 6 mm drill bit to widen the centre hole so that the potentiometer axle fits in there.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-095QDXUzeFc/TwSvFk77ZFI/AAAAAAAAAOk/MEOXvCEf7t8/s1600/2011-10-16+14.18.46.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://2.bp.blogspot.com/-095QDXUzeFc/TwSvFk77ZFI/AAAAAAAAAOk/MEOXvCEf7t8/s320/2011-10-16+14.18.46.jpg" width="320" /></a></div>
<br />
For the markings on the control panel and the two main knobs I used transfer lettering from <a href="http://www.letraset.com/shopaff.asp?affid=42">Letraset</a>. This is rub-down lettering, that is, you write by finding the required letter from the sheet, placing that to its intended place and rubbing down on the letter sheet so that the letter material is transferred from the sheet to your working piece. These are mainly intended to be used on paper, but they appear to work just fine on wood and plastic.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-GGcpna1KFTs/TwSvcxguCOI/AAAAAAAAAOs/nU_Rb5S460I/s1600/2011-10-19+20.40.25_v1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="132" src="http://2.bp.blogspot.com/-GGcpna1KFTs/TwSvcxguCOI/AAAAAAAAAOs/nU_Rb5S460I/s320/2011-10-19+20.40.25_v1.jpg" width="320" /></a></div>
<br />
After writing all the texts I wanted, I coated the control panel, the two red knobs and the box with several (probably three) coats of clear spray lacquer. Before this it would have been possible to rub or scrape the lettering off, though it would have taken some effort. After the lacquer coat the lettering is there to stay. Even though the spray again had quite an amount of solvents, neither the lettering nor the plastic of the two red knobs was adversely affected.<br />
<br />
After this, the rest is rather straightforward. I re-attached the hinges and the clasp I had removed before painting the box white. I installed the potentiometers, buttons, switches and the line jack to the control panel with their supplied nuts. The two LEDs and the speaker I attached with hot glue. Eventually I will have to figure out something more sturdy than hot glue for mounting the speaker, for it did come loose at the <a href="http://www.altparty.org/2011/">Alternative Party</a>. The control panel is held in its place by the side walls of the box and the support bars inside the box, but there's nothing stopping you from lifting it upwards to reveal the electronics hidden inside.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com0tag:blogger.com,1999:blog-8964583752416945383.post-49299333179586109382011-11-20T19:15:00.001+02:002011-11-21T20:20:16.563+02:00Soundbox — what makes it tickI did have the soundbox device I have built with me at <a href="http://www.altparty.org/2011/">Alternative Party 2011</a>. It did attract a fair amount of interest, though nowhere near what my 32×8 LED screen did. I think I'll have to write a post about that LED screen and how it works some time. For quick info, it's built around an ATmega328, can show 16 different shades of green with gamma ramp and shows some classical effects such as plasma and fire.<br />
<br />
Neither one of my projects gained nowhere near the interest that the <a href="http://www.hacklab.fi/2011/10/alt-party-ohi-helsinki-yha-olemassa/">Chernobyl reactor simulator</a> by Helsinki Hacklab did, but that is only to be expected. That simulator was awesome, even though they didn't quite manage to get it to a playable state during the event.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt6EedRienXe6JPmtPdhXe-g1-AJpne948k0vyMwa86Z87qfLlsP5i8J42THpOPtSvZhTw9Wqsg-fRGMAH33I8WbVDfau1XjvySUxADltaEr1UXQiht7BOouQM9eLcgL1SL4PTU7qYy57H/s1600/soundbox.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="286" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt6EedRienXe6JPmtPdhXe-g1-AJpne948k0vyMwa86Z87qfLlsP5i8J42THpOPtSvZhTw9Wqsg-fRGMAH33I8WbVDfau1XjvySUxADltaEr1UXQiht7BOouQM9eLcgL1SL4PTU7qYy57H/s320/soundbox.jpeg" width="320" /></a></div>
<br />
I'll first describe the high-level workings of the soundbox, then the hardware side and last the software used.<br />
<br />
<b>High-level view</b><br />
<br />
The device is a looper: it plays a short loop of sounds over and over again and the sounds can be altered while the device is playing. It provides two channels, each with its own waveform and each separately programmable. The loop is 128 sounds long and the actual length of loop in seconds depends on the setting of tempo knob.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA9cQwtT0P4iJU7Wj_pvX4t5-9xo1YMPW9UF6ukHhqFXBiB0RxbGQpXTjU1_Nd_90EgxLqM80XmOmjOsS7KbQczH0A4f00diTdrNuRjcDpag9sunh3zmtXovdmOrRq_8j7mLRlIkdOyqm9/s1600/soundbox-panel.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="145" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA9cQwtT0P4iJU7Wj_pvX4t5-9xo1YMPW9UF6ukHhqFXBiB0RxbGQpXTjU1_Nd_90EgxLqM80XmOmjOsS7KbQczH0A4f00diTdrNuRjcDpag9sunh3zmtXovdmOrRq_8j7mLRlIkdOyqm9/s320/soundbox-panel.jpg" width="320" /></a></div>
<br />
The first sound channel plays sine wave and the second channel plays pitched noise. One of the device controls is a pitch knob that can be used to select the frequency of sine wave of noise to be programmed.<br />
<br />
For sine wave there's also second knob — arpeggio — which can be used to alternate between the base pitch and a higher pitch at a high rate. The rate is fixed depending on tempo and the setting of arpeggio knob defines how much higher is the higher pitch.<br />
<br />
Also there's a beat LED that flashes four times during every loop through the sound loop — white at the beginning of loop and red the other three times. This is to help the user see how fast a tempo the device is using.<br />
<br />
The front panel also features a built-in speaker which is mere 5 cm across but can produce surprisingly high volumes — even at the active party hall it was able to put out enough volume to be clearly audible at close quarters. I've tried some small commercial speaker devices intended to be attached to portable CD/MP3 players and found that they can't put out nearly enough volume in such situations, so I was somewhat surprised that this simple device could.<br />
<br />
<b>The hardware design</b><br />
<br />
The hearth of this device is Atmel ATmega88 microcontroller running at 16 MHz. Sporting 8 kB of flash memory and 8 kB of RAM, this microcontroller is the little brother of ATmega328 that is used in the popular <a href="http://www.arduino.cc/">Arduino</a> prototyping board.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic8qVP-5PWZKaVcYjGZMwdHeccRPM7Swu1MeIyNNhMwAGbvX1FfBOEnLfJGE21Ec0hG7U2SqmyXrOClAOFW6Y4tlXgii41bxet2C_i5UwTID4_R-o3-K_s-QTMbRdJJsAipugH61HE8jtk/s1600/soundbox-proto.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="242" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic8qVP-5PWZKaVcYjGZMwdHeccRPM7Swu1MeIyNNhMwAGbvX1FfBOEnLfJGE21Ec0hG7U2SqmyXrOClAOFW6Y4tlXgii41bxet2C_i5UwTID4_R-o3-K_s-QTMbRdJJsAipugH61HE8jtk/s320/soundbox-proto.jpg" width="320" /></a></div>
<i>Early version of the hardware</i><br />
<br />
With the built-in analog-to-digital converter in ATmega88 it is simple to read the positions of the three 10 kΩ linear potentiometers used for pitch, arpeggio and tempo. The potentiometers are connected across device ground and regulated 5 V lines, so turning a potentiometer changes the voltage at its middle pin linearly between these two voltages. This voltage is read with the ADC in the microcontroller and used to control the sound generation.<br />
<br />
The microcontroller outputs the sound using <a href="http://en.wikipedia.org/wiki/Pulse-width_modulation">Pulse-width modulation</a> and uses a simple resistor-capacitor low-pass filter so that only frequencies below the <a href="http://en.wikipedia.org/wiki/Nyquist_frequency">Nyquist frequency</a> of the output are passed to amplifier and eventually to speaker. Or at least this was the idea — I don't know quite exactly the frequency response of the filter I built, especially as I ended up swapping some of the capacitors to different value than the one originally planned, since I didn't have any with correct value and could not be bothered to visit the electronics store to get a couple capacitors. Anyhow, it sounds good and looking at the output with an oscilloscope doesn't show modulation frequency passed through, so I guess it's fine.<br />
<br />
After the low-pass filter is the volume control: a 10 kΩ logarithmic potentiometer. After it there's a <a href="http://en.wikipedia.org/wiki/LM386">LM386</a> amplifier chip that drives the speaker or the device connected to the line out jack. One notable thing is that this amplifier chip is not connected to the regulated 5 V line that is being used to drive the ATmega88, but to the unregulated voltage straight from the batteries. This is done to maximize the voltage available to the amplifier chip — which means more volume — and to ease the load on the regulator, which is simple <a href="http://en.wikipedia.org/wiki/78xx">7805</a> linear regulator that can generate considerable amounts of heat if heavily loaded or if the difference between its input and output voltages is large.<br />
<br />
Speaking of batteries and voltage regulation, the power source for this device is six AA size NiMH cells. With nominal voltage of 1.2 V each, the total voltage is 7.2 V — high enough so that the 7805 can produce stable 5 V supply and well inside the operating voltage range for LM386.<br />
<br />
<b>The software</b><br />
<br />
The software for the soundbox is written in C using the <a href="http://www.nongnu.org/avr-libc/">AVR libc</a> library.<br />
<br />
The sounds to be played are stored in two 128 bytes long arrays, one for each voice. Each byte in these arrays corresponds to one sound to be played, the value defining the pitch of the sound.<br />
<br />
At the hearth of the sound generation is a <a href="http://en.wikipedia.org/wiki/Numerically_controlled_oscillator">numerically controlled oscillator</a> (NCO). The oscillator for sine voice uses 256 samples long phase-to-amplitude converter array that is filled with sine values at device boot up. The noise channel uses similar table filled with random values with Gaussian distribution, creating a table that contains white noise. The oscillator for noise channel advances in its table 4096 times slower than sine oscillator of same frequency. This value has been chosen experimentally so that sine and noise with same pitch setting would sound like having somewhat similar pitch.<br />
<br />
The sound generation itself is done inside the overflow interrupt of an pulse width modulation timer that's built-in in ATmega88. Each time the timer overflows — every 256 processor ticks in my configuration — a new sound amplitude is computed from the two NCOs and written in pulse width control register.<br />
<br />
Reading inputs and setting the frequencies of the two NCOs is done in the main program loop. Each loop of the main program moves one step forward in sound arrays, reads inputs, writes new sound values to sound arrays if needed and sets the frequency controls of NCOs according to the values in sound arrays. After this it runs NOP command in a loop a suitable number of times to wait until new sound is to be played.<br />
<br />
That's it for this time. I'm thinking of posting something about how I made the enclosure, especially the labels on the panel and buttons. Maybe some recording of the sounds I get from the device, too.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com0tag:blogger.com,1999:blog-8964583752416945383.post-80842687645251797122011-10-20T22:45:00.001+03:002011-10-20T22:49:09.388+03:00Soundbox project and Alternative partyI've been building a digital instrument that has been inspired by the <a href="http://makezine.com/26/lunamod/">Luna Mod</a> which was presented in the Make magazine some while ago. It is a two-voice software synthesizer implemented on an Atmel ATmega88, an eight-bit microcontroller. It plays a short loop of sounds which are programmable by selecting suitable pitch and amount of arpeggio and pressing a programming button.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVzLql4zBye0EmhLOOsP5Uodw8FJO54_TruJ2Umq5EUsTmkTmpUq7vppVP8Xv75FLoAUxgDvNJRkzVtmYv5zPc01hvrSzgnYPHLfm6iyc8dMFxlXOSQFScslxGZ1qgVuy18lpCZRhk_kAs/s1600/soundbox.jpeg" imageanchor="1" style="margin-left:1em; margin-right:1em"><img border="0" height="358" width="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVzLql4zBye0EmhLOOsP5Uodw8FJO54_TruJ2Umq5EUsTmkTmpUq7vppVP8Xv75FLoAUxgDvNJRkzVtmYv5zPc01hvrSzgnYPHLfm6iyc8dMFxlXOSQFScslxGZ1qgVuy18lpCZRhk_kAs/s400/soundbox.jpeg" /></a></div><br />
I will present this device for the first time at <a href="http://www.altparty.org/2011/">Alternative party 2011</a> which starts in less than 24 hours. It's a festival for many sorts of digital art, especially demos (as in demoscene, not short versions of games) and there have been many electronics enthusiasts – such as <a href="http://koelse.org">KOELSE - Association of Experimental Electronics</a> and <a href="http://hacklab.fi">Helsinki Hacklab</a> – in the last years. I'm confident this project will fit right in there.<br />
<br />
I'll write more about this project soon, at least something about the electronics and software design in this device and about how the control panel was made.<br />
<br />
The source files and an electronics design drawing made in <a href="http://fritzing.org/">Fritzing</a> are available at a <a href="https://github.com/kiirala/soundbox">GitHub repository</a>.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com0tag:blogger.com,1999:blog-8964583752416945383.post-15337607129245392432011-08-06T17:15:00.000+03:002011-08-06T17:15:55.380+03:00Drawing for Assembly 2011I created this image on Inkscape for the Fast Graphics competition at <a href="http://www.assembly.org">Assembly</a> 2011. The theme for this year was <i>Last minute</i> and there was one and half hours time to make the image, from when the theme was published to submission deadline. Sadly, this didn't make it past jury and thus wasn't show on big screen.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKtFDoSLzJrZhQH1LMBn6-vlZGEWbM39iHLMUn93-M7tB7OhTITgDbfNZFxrS8wRqesAISL2eqgpS3OHRHuVUDiB0OK0SRqXFmugkKj4UsKq-RQUyVVHtmnXOjQTDDdc1dK1mK242o-tcs/s1600/viimeminuutti.png" imageanchor="1" style="margin-left:1em; margin-right:1em"><img border="0" height="225" width="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKtFDoSLzJrZhQH1LMBn6-vlZGEWbM39iHLMUn93-M7tB7OhTITgDbfNZFxrS8wRqesAISL2eqgpS3OHRHuVUDiB0OK0SRqXFmugkKj4UsKq-RQUyVVHtmnXOjQTDDdc1dK1mK242o-tcs/s400/viimeminuutti.png" /></a></div><br />
Not the best of my drawings, I admit. In 2009 I did manage to get my drawing on big screen. That time the theme was "Over the edge" or something like that and time limit again 1½ hours. Here's the result, drawn in Inkscape.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijbIkHXVezfVZcgCC-wS1TGEGSuqOTzWpHTlSW2ZRF-STlCNDOAmtTAavQphFoL90k2Owszd9iYK91ZjMgOAYjhvXMU4ODiocWFm-bh8sivEuLNnNQfRnhL8-Tb0MDHhstgwhs5ybFUtcj/s1600/sharp_edges_nosig.png" imageanchor="1" style="margin-left:1em; margin-right:1em"><img border="0" height="225" width="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijbIkHXVezfVZcgCC-wS1TGEGSuqOTzWpHTlSW2ZRF-STlCNDOAmtTAavQphFoL90k2Owszd9iYK91ZjMgOAYjhvXMU4ODiocWFm-bh8sivEuLNnNQfRnhL8-Tb0MDHhstgwhs5ybFUtcj/s400/sharp_edges_nosig.png" /></a></div><br />
The SVG source files are available at <a href="https://github.com/kiirala/filters_tutorial/tree/master/drawings">my GitHub reposistory</a>.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com0tag:blogger.com,1999:blog-8964583752416945383.post-5499807502120887532011-07-13T21:57:00.000+03:002011-07-13T21:57:07.633+03:00Blender M3G export errorI'm attempting to build a game atop <a href="http://kajak3d.com/">Kajak3D</a> framework. For that I'm creating models in <a href="http://www.blender.org/">Blender</a> and exporting them to M3G format.<br />
<br />
Well, exporting my very first model failed with "Python script error: Check console". After figuring out that this doesn't mean any Blender-internal console, but plain old console output, I closed Blender and started it from a terminal window. So, I received this message:<br />
<pre style="font-size:small">translate mesh ...[Object "Body"]
1 material(s) found.
Traceback (most recent call last):
File "/usr/share/blender/scripts/export_m3g.py", line 3068, in file_callback_m3g
exporter.start()
File "/usr/share/blender/scripts/export_m3g.py", line 2680, in start
world = Translator.start()
File "/usr/share/blender/scripts/export_m3g.py", line 2022, in start
self.translateMesh(obj)
File "/usr/share/blender/scripts/export_m3g.py", line 2296, in translateMesh
if material.getMode() & Material.Modes.TEXFACE: createUvs = True;
AttributeError: 'NoneType' object has no attribute 'getMode'
</pre><br />
My first thought of that was that the first "material" is likely typed with wrong capitalization and should have been "Material". But it is not so: both capitalized and non-capitalized version are actually valid in that script at that point...<br />
<br />
Google search didn't find anything on fixing that error, just one unanswered forum post asking how to fix it. Anyhow, I found the solution and decided to post it here, in case anyone else bumps into same issue.<br />
<br />
<b>The solution</b><br />
Link the object material to object mesh, not to whole object.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzxTpfEf1bm3TXBIVZjmExK_wfIxB86g1ubi78lMwPGfwyKPsFF-xMRoilzi3pz5SxsxF5H03oBnYuiH6iQr43yWFiIAF7FUyL-0tEhg9d0oHMWhuZ2nFiByqBZhLFIvfhXKWZzULrAS5Q/s1600/blender-m3g-trouble.png" imageanchor="1" style="margin-left:1em; margin-right:1em"><img border="0" height="125" width="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzxTpfEf1bm3TXBIVZjmExK_wfIxB86g1ubi78lMwPGfwyKPsFF-xMRoilzi3pz5SxsxF5H03oBnYuiH6iQr43yWFiIAF7FUyL-0tEhg9d0oHMWhuZ2nFiByqBZhLFIvfhXKWZzULrAS5Q/s400/blender-m3g-trouble.png" /></a></div>Note the circled area: your settings should look like this. You can click on "OB" to see if there are any materials linked to the object and to remove them.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com0tag:blogger.com,1999:blog-8964583752416945383.post-26615395926568875532011-04-28T12:34:00.000+03:002011-04-28T12:34:57.378+03:00Making buttons with Inkscape<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpaDvuDe5CN4Y1ykqn5fScDHMLXWbF0GMrp67ExIi19QTTwuJLnkQ3hPLsIv6ADS85UnHu_Ba_HG55WJOWlmut6lTIY7DBYKrZ3-4IVosMRCEXIT2hC_g51PZVu_val3NjrYutLoGFKE_M/s1600/badge_photo.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"><img border="0" height="300" width="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpaDvuDe5CN4Y1ykqn5fScDHMLXWbF0GMrp67ExIi19QTTwuJLnkQ3hPLsIv6ADS85UnHu_Ba_HG55WJOWlmut6lTIY7DBYKrZ3-4IVosMRCEXIT2hC_g51PZVu_val3NjrYutLoGFKE_M/s400/badge_photo.jpg"></a></div><br>
During my university studies I've made several buttons for TKO-äly, the organization for computer science students at Helsinki University. Here I'll describe my method for creating these buttons. The usual process is that I first sketch the button on paper, then draw the main image on paper or with Inkscape. Finally I composite the image with background and place several complete images on a single A4 sheet for printing, both using Inkscape. The printed images are then cut out from the paper sheet and made into buttons using a hand-operated button tool.<br>
<br>
This post will be rather image-heavy, so it'll continue after the jump.<br>
<a href="http://fedev.blogspot.com/2011/04/making-buttons-with-inkscape.html#more">Read more »</a>Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com2tag:blogger.com,1999:blog-8964583752416945383.post-48241272159545364712011-04-19T14:31:00.006+03:002011-04-19T16:00:23.115+03:00Filter effects: Gaussian blur<span style="font-style:italic;">This is part of my Filter effects tutorial series.</span><br /><br />Gaussian blur makes objects appear softer and less clearly defined. Even by itself it is so useful that it was the first filter effect to be implemented in Inkscape. It also has received an own place in the Fill and Stroke editor:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNynZpyPHM1kftk-87y3JUhEbPs4GAOQV1J0OjK1LZX-1Qd2gvA4GXYVhHdG-qIr9FlcQsp2Zi-unrbfXEdz79neM0jbXgNy0qjMleFy8FBF3mz9qLbBNlaMi3XL3Kd8oFtzTKx6Aqn3in/s1600/blur_slider.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 278px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNynZpyPHM1kftk-87y3JUhEbPs4GAOQV1J0OjK1LZX-1Qd2gvA4GXYVhHdG-qIr9FlcQsp2Zi-unrbfXEdz79neM0jbXgNy0qjMleFy8FBF3mz9qLbBNlaMi3XL3Kd8oFtzTKx6Aqn3in/s400/blur_slider.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5597266525589935042" /></a><br />When you use that slider, it creates a filter effect that contains a single Gaussian blur primitive and attaches that to selected object.<br /><br />There are different kinds of blur. In Gaussian blur the colour from any pixel spreads out according to the Gaussian function (aka. bell curve). That means that the colour of any pixel stays mostly near itself, but some colour spreads out to a large area – in fact the colour spreads out to an infinitely large area, but in practise the contribution can't be seen quite far away. Another example of blur would be <span style="font-style:italic;">bokeh</span>, the depth of field effect seen when some objects in a photo are out-of-focus. It is quite different from Gaussian blur: bokeh depends on the camera lens used, but usually spreads colour evenly to a circular area.<br /><br />Gaussian blur is also useful as part of more complex filters. Many of the pre-defined filters in Inkscape distribution include blur. Here I'll show a couple examples. First up is drop shadow:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFZkBKDMwE-IsJOp91zK7Ygheisg811FLAFxTKSQ0_SiIEPZ0CgLVCAQ-SdjGxiGUbhYahqdCU61HOKVNqDWE61IKcaZfx6EHjK1IQwUmsETRhPtmhQa_-2hDk5dDMZwNet4OdkkH-azjh/s1600/blur_dropshadow.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 277px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFZkBKDMwE-IsJOp91zK7Ygheisg811FLAFxTKSQ0_SiIEPZ0CgLVCAQ-SdjGxiGUbhYahqdCU61HOKVNqDWE61IKcaZfx6EHjK1IQwUmsETRhPtmhQa_-2hDk5dDMZwNet4OdkkH-azjh/s400/blur_dropshadow.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5597275270771467682" /></a><br />Here the Flood primitive is used to set the shadow colour, Gaussian blur to make the shadow softer and Offset to move the shadow.<br /><br />Next up is filter that shows only object edges:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYHK6T3w3dYx5XJKvFMgaVabkdLqqq1PYur7EDE5ekeOThGh2n64P0Jqol-AwRzX55KchNBqwsd-WY4Evs4q-YRVE2gBC8qsc75HfAjScgYWuvTVcl7W474liyM1fZFOQVsrOF-aqo-XIN/s1600/blur_only_edge.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 334px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYHK6T3w3dYx5XJKvFMgaVabkdLqqq1PYur7EDE5ekeOThGh2n64P0Jqol-AwRzX55KchNBqwsd-WY4Evs4q-YRVE2gBC8qsc75HfAjScgYWuvTVcl7W474liyM1fZFOQVsrOF-aqo-XIN/s400/blur_only_edge.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5597275860132625746" /></a><br />The Composite is in mode "out", meaning that we take parts of original image that are not in blurred image.<br /><br />Last up is lighting filter, which requires a height map. Gaussian blur can be used to create an easy height map.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRBlDImpWt55qTAmSmd2834_Rk8M_jxzyLur31eIMCdnqFoBUtN__3WWSKPAgvZmgZ4F2xlDRWglr2CYeo35apRmpytx4OwdYTtWPyepRT1Iqrax3N6XdmXIv1sgXYOpJBCkStoWfpM-bG/s1600/blur_diffuse_light.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 317px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRBlDImpWt55qTAmSmd2834_Rk8M_jxzyLur31eIMCdnqFoBUtN__3WWSKPAgvZmgZ4F2xlDRWglr2CYeo35apRmpytx4OwdYTtWPyepRT1Iqrax3N6XdmXIv1sgXYOpJBCkStoWfpM-bG/s400/blur_diffuse_light.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5597276841218972498" /></a><br /><br />The SVG sources for the images are available from my <a href="https://github.com/kiirala/filters_tutorial">filter tutorials repository</a> at GitHub.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com0tag:blogger.com,1999:blog-8964583752416945383.post-5723993109274556612011-04-17T17:33:00.007+03:002011-04-17T20:05:38.643+03:00Filter effects: Flood<span style="font-style:italic;">This is part of my Filter effects tutorial series.</span><br /><br />Flood may be the most simple filter primitive there is. It simply fills the whole filter area with one colour. By itself it's mostly useless, but it's often handy as part of more complex filters.<br /><br />Here's a simple – almost stupid – example to show what Flood does by itself:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBBBMc53eaBULQQ7OjCXvyK5AIYypzxzyCnqefkheilSEtcplizKwy2K3i2QL4ByupCN-BU4kxdUp9jmSHFYIxpxoco-n2-I1blk68UQg4uiMBS_mTiCvv6wJ9rksoHeOC4v9IHdXcw3O8/s1600/flood_simple_editor.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 319px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBBBMc53eaBULQQ7OjCXvyK5AIYypzxzyCnqefkheilSEtcplizKwy2K3i2QL4ByupCN-BU4kxdUp9jmSHFYIxpxoco-n2-I1blk68UQg4uiMBS_mTiCvv6wJ9rksoHeOC4v9IHdXcw3O8/s400/flood_simple_editor.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5596562201385450594" /></a><br />When you have a filter like this, the result will look like this:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWeP-uljpfq7bN4gol8NTtX1jipCK7L6KmS72JQ0UmhxsQS4sjXcjEImprJny_fZucnKCxbuQMFdrueNi5BuBKmb0aFEe9xilS61btUlmZmt2C0IkN-H78BWoeJmuTmM1qHUeGNNJ4IyOk/s1600/flood_simple.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 183px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWeP-uljpfq7bN4gol8NTtX1jipCK7L6KmS72JQ0UmhxsQS4sjXcjEImprJny_fZucnKCxbuQMFdrueNi5BuBKmb0aFEe9xilS61btUlmZmt2C0IkN-H78BWoeJmuTmM1qHUeGNNJ4IyOk/s400/flood_simple.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5596562325228979826" /></a><br /><br />Of course, this is probably the most inefficient way of using Inkscape to create a solid-coloured rectangle. So let's take a more interesting example. If you have ever tried to add a thick stroke to a text, you will have noticed that the result doesn't look too good. One way around this problem is to create a filter as follows:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwLyNx1UEpxWbQMFK5RnP9joVqSF5Ov8k8whCK_zcoq0VcCNe_vhDdgEUu3e_Vh4WqwVL65c4_DY-0SelCpflVxyri20Eowx7cX__hrtLgZWj5nsMkQc7ajNvS5oFT3qvKkYO-hJAQPsY0/s1600/flood_text_stroke_editor.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 381px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwLyNx1UEpxWbQMFK5RnP9joVqSF5Ov8k8whCK_zcoq0VcCNe_vhDdgEUu3e_Vh4WqwVL65c4_DY-0SelCpflVxyri20Eowx7cX__hrtLgZWj5nsMkQc7ajNvS5oFT3qvKkYO-hJAQPsY0/s400/flood_text_stroke_editor.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5596565898816113570" /></a><br />Here I use the Morphology filter primitive in Dilate mode to create a thicker version of the text and Flood filter primitive to create the stroke colour. With Composite I do the operation "stroke colour <span style="font-weight:bold;">in</span> thick text", essentially colouring the thick text with my intended stroke colour. Finally, I take this thick, coloured text and composite the original text on top of it with Merge.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuADXoi2O1GF5n5BkSL6GR6nWM-bCOs-x7XdKCLcrOhHcJZsGka662dwqamNgzaNylRseZS_LKXqtwbzrzxFFr872KjM3f20gj3Ft5WouwrCu2hBLEXuvbbiLB7ZRcLTvolp9kVXQO-kGn/s1600/flood_text_stroke.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 249px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuADXoi2O1GF5n5BkSL6GR6nWM-bCOs-x7XdKCLcrOhHcJZsGka662dwqamNgzaNylRseZS_LKXqtwbzrzxFFr872KjM3f20gj3Ft5WouwrCu2hBLEXuvbbiLB7ZRcLTvolp9kVXQO-kGn/s400/flood_text_stroke.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5596567606848624946" /></a><br />As you can see here, the version using stroke paint has certain problems, especially with the small holes in 'a', 'e' and 'f'. The filter produces a much nicer look, preserving the outline shape of the letters.<br /><br />In a similar fashion you can use Flood in other filters to add in colours that don't exist in the original image.<br /><br />The SVG sources for the images are available from my <a href="https://github.com/kiirala/filters_tutorial">filter tutorials repository</a> at GitHub.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com0tag:blogger.com,1999:blog-8964583752416945383.post-4624203804178962662011-04-14T11:17:00.007+03:002011-04-14T14:28:12.715+03:00Filter effects: Displacement map<span style="font-style:italic;">This is part of my Filter effects tutorial series.</span><br /><br />Displacement map is used to warp images in different fashions. For example many of you may have seen a screen saver that warps a small, moving area of the desktop. That warping effect is done with a displacement map.<br /><br />The displacement map filter primitive takes two input images: the image to be warped and a displacement map. The colour in displacement map defines, where the colour for this pixel should come from: you can pick one of the red, green, blue and alpha colour channels for vertical displacement and one for horizontal displacement. Light colours in selected channel make the filter take colours from below or right (or moves the image up or left). Likewise dark colours get the filter to pick colours from above and left. Mid-grey means zero displacement.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggh5EbjaGput4hg-IPRwJxn09iwjn4Y2xfylqgOobL2Var_lDSktekr2FEoNTSJUgwyYF1IbBe9DfYQA6Q2tnV49zGzspA3jO9OmikQ920R94_m7Wbj1j_YDyXOiqX8uhb8akpu9cVsNHc/s1600/displacement_rendering.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 234px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggh5EbjaGput4hg-IPRwJxn09iwjn4Y2xfylqgOobL2Var_lDSktekr2FEoNTSJUgwyYF1IbBe9DfYQA6Q2tnV49zGzspA3jO9OmikQ920R94_m7Wbj1j_YDyXOiqX8uhb8akpu9cVsNHc/s400/displacement_rendering.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5595397118912893378" /></a><br /><br />Here are some examples what filters can do. The top two cases show how solid colour displacement map simply moves the image (Offset filter is better for that, though). Interesting results come from using gradients (3rd example) or noise (4th example, using Turbulence filter)<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP53qjLg3PeX2kOoAqrQoDcl2eKCmaWSgxT92s_hyy9YH88uMvkhc4CTpLctNGfrXxjTtg_FCLfOXqJ-SwPT1iO8dDgQD6vZ70wxGW4c4r_LO4uq63yMixSyXsPKLlmsoueOoD6pmgDJQD/s1600/displacement_example.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 261px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP53qjLg3PeX2kOoAqrQoDcl2eKCmaWSgxT92s_hyy9YH88uMvkhc4CTpLctNGfrXxjTtg_FCLfOXqJ-SwPT1iO8dDgQD6vZ70wxGW4c4r_LO4uq63yMixSyXsPKLlmsoueOoD6pmgDJQD/s400/displacement_example.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5595363177484904914" /></a><br /><br />These examples used filter set up as follows:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnVlMGs5lmVrMOFTug_5fvIa-mWIH3ZR8qWM667uh3bZBhfAMHcjmIlCSgkHKD1RrDZTTdRKqHrokVl4t5wJsrZ1a5LCh1O2YMFYYMPrUxRphJ2JzCiMvMlqhWRGI0RMydHBRWMspz3xfq/s1600/displacement_editor.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 377px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnVlMGs5lmVrMOFTug_5fvIa-mWIH3ZR8qWM667uh3bZBhfAMHcjmIlCSgkHKD1RrDZTTdRKqHrokVl4t5wJsrZ1a5LCh1O2YMFYYMPrUxRphJ2JzCiMvMlqhWRGI0RMydHBRWMspz3xfq/s400/displacement_editor.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5595364937737144178" /></a><br />The Image filter primitive is used to grab the bunny as source image and then displacement map filters that using its own colours as the displacement map. This is for top two examples, the bottom two are similar but use scale of 28.8.<br /><br />The meaning of displacement map setting is as follows:<br /><ul><br /><li>First input image specifies the image to warp</li><br /><li>Second input image specifies the displacement map</li><br /><li>Scale specifies how large displacement should be</li><br /><li>X and Y displacement specify the colour channels to use for horizontal and vertical displacement, respectively</li><br /></ul><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP9mRJDRFIElJcBfWiEe1ltBPvlZKPwkxBKl9trfheacF5MEOp4W79aEVO1UsTfNAczoKMxyHtLbPA-2fdyOul6DtZ7OziXqyQBfZqbCoG7lqBcW-o_rICS8UnpOjEmZGmjj9FALNPrQ92/s1600/displacement_amount.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 82px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP9mRJDRFIElJcBfWiEe1ltBPvlZKPwkxBKl9trfheacF5MEOp4W79aEVO1UsTfNAczoKMxyHtLbPA-2fdyOul6DtZ7OziXqyQBfZqbCoG7lqBcW-o_rICS8UnpOjEmZGmjj9FALNPrQ92/s400/displacement_amount.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5595399211925018866" /></a><br /><br />There are some gotchas in building displacement map filters. It is best to use only completely opaque colours or only different levels of opacity to specify the displacements: on low opacities the colour information may be partially or even completely lost and this'll cause problems. The second thing is that the filter effects editor in Inkscape has occasional problems: on new displacement map primitive it may be needed to explicitly change X and Y displacement to non-default values (and back again, if you want the default)<br /><br />The SVG sources for the images are available from my <a href="https://github.com/kiirala/filters_tutorial">filter tutorials repository</a> at GitHub.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com2tag:blogger.com,1999:blog-8964583752416945383.post-35747116419304572372008-07-28T15:17:00.005+03:002011-04-28T13:17:01.700+03:00Never Trust a Smiling Succubus?So, she approaches you, with bright smile and cute-but-curvy looks. Talks sweet nothings to your ear. Why should there be anything to worry about? Horns? What horns?<br />
<br />
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizxWcqqhlsxySsPkUwIM07GpDGj5vOPqJ3q37ySHLhwBPKuB_1qbdrFuzD9l8X7C3vyWWfwwY-QtSsFW3fiOV2qbspgvOi0arzKpZaBL1xy7crPIUW_QZ_iZBm8VaOZWCWirH1-MNXeaN3/s1600-h/cyan_succubus.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizxWcqqhlsxySsPkUwIM07GpDGj5vOPqJ3q37ySHLhwBPKuB_1qbdrFuzD9l8X7C3vyWWfwwY-QtSsFW3fiOV2qbspgvOi0arzKpZaBL1xy7crPIUW_QZ_iZBm8VaOZWCWirH1-MNXeaN3/s400/cyan_succubus.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5228040543846805714" /></a><br />
<br />
<a href="http://www.letraset.com/shopaff.asp?affid=42">Markers</a> and black pen on paper. Inspiration from one of the greatest webcomics out there, <a href="http://www.sinfest.net">Sinfest</a>. That comic's been running for eight years straight and still going strong.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com3tag:blogger.com,1999:blog-8964583752416945383.post-32126786982806810842008-07-06T18:32:00.004+03:002008-07-06T18:49:11.393+03:00BubblunThis project has been unfinished for far too long, so this week I decided to complete it. And now it's finished, at last! So let me present to you: my own super-huggable video game plushie.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdqAwbfu_GmNSEMm_8qxAaJ14GfSn6FDImsRbxN6LCY1kkbD5OHNnet9Pnt9vNSmxAveqjxwBFi66_36K1WnY0DFuVAC_fG25v22eVdod3LHhtxNKltqcEr01rzdfMxT3y0KB9VT76-KJH/s1600-h/bubblun.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdqAwbfu_GmNSEMm_8qxAaJ14GfSn6FDImsRbxN6LCY1kkbD5OHNnet9Pnt9vNSmxAveqjxwBFi66_36K1WnY0DFuVAC_fG25v22eVdod3LHhtxNKltqcEr01rzdfMxT3y0KB9VT76-KJH/s400/bubblun.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5219925731516679634" /></a><br /><br />Made of cotton cloth, fiberfill, a bit felt and plenty of thread, it's my second hand-made plushie. The first was Tux, made to the <a href="http://free-penguin.org">Free Penguin Project</a> patterns.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com0tag:blogger.com,1999:blog-8964583752416945383.post-49450837941414257682008-07-02T10:59:00.008+03:002008-07-02T13:28:40.485+03:00Filter effects: Lighting effects<span style="font-style:italic;">This is part of my filter effects tutorial series</span><br /><br />Lighting effects can help in creating a feeling of depth in you image. They take in a height map and various light and material parameters and produce a light map. This light map can then be composited with your object to produce a result that looks like light falling on the object.<br /><br />There are two lighting filters: Diffuse Lighting and Specular Lighting. This is how lighting is usually created in computer graphics. Diffuse is how the light reflects off a completely matte object, the sides facing light are brighter and sides facing away from light are darker. Specular in turn is how the light reflects off a smooth surface, it creates bright spots where the light reflects towards the viewer.<br /><br />There are two other common lighting properteries: ambient lighting and mirror reflection. Ambient is the light that doesn't seem to come from any particular direction. In filter effects, ambient component comes from the original colour of the object. Mirror reflections, as the name states, are reflections that show the image of other objects. Mirror reflections are not supported by this simple lighting model.<br /><br />First, before I'll explain these filters more throughly, I'll tell you a bit about height maps. SVG drawings are two-dimensional and as such, they don't actually contain any depth information. Without depth information, everything in the scene is completely flat, and lighting totally flat objects would be rather useless, because everything would be of same brightness. Height maps are used to overcome this problem. Any image can be used as height map, the transparent areas of image are the lowest point and the more opaque a point is, the more it is considered to be above image plane.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXktNj3nja85Jlu-g8AY7J6e0xQeEcsFyLxSpdB-cY8Am754lzA7w6siW6I0tJzwUdzZ-RBS8r8A4qzzPTSnBYwjrUZclMqXwxQCKmLt6cUrAhYhBL012riKYR_BBWTST5VQupAwRCYalp/s1600-h/lighting_heightmap.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXktNj3nja85Jlu-g8AY7J6e0xQeEcsFyLxSpdB-cY8Am754lzA7w6siW6I0tJzwUdzZ-RBS8r8A4qzzPTSnBYwjrUZclMqXwxQCKmLt6cUrAhYhBL012riKYR_BBWTST5VQupAwRCYalp/s400/lighting_heightmap.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5218338309850398770" /></a><br />In this image, the height map here is completely black and lighter shades are more transparent areas. The light comes from top-left. You can see how this height map is used to create the looks of light falling on three-dimensional object.<br /><br />For practical uses, it is often useful to create the height map automatically from the filtered object. Gaussian Blur, for example, is handy for this. The next image shows a height map derived from original object by Gaussian Blur<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4gvtxump6D7ibSPZWhovf-C8GDgjZRhhTZLaojn9ntpQNAtlZmqSzGYtYHrV396UKqnqna21vSVwMkD7RtKfbVgGHAd6xsVwISv8irQQlSM1b3h4NGVXuUwtRLVw5qnjk-Spdp4mWUD14/s1600-h/lighting_max_heightmap.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4gvtxump6D7ibSPZWhovf-C8GDgjZRhhTZLaojn9ntpQNAtlZmqSzGYtYHrV396UKqnqna21vSVwMkD7RtKfbVgGHAd6xsVwISv8irQQlSM1b3h4NGVXuUwtRLVw5qnjk-Spdp4mWUD14/s400/lighting_max_heightmap.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5218343707029263730" /></a><br />Again, the white areas in height map are transparent and more dark areas more opaque. The red line shows the original shape of the object, it's not actually part of the height map. The used lighting filter is from examples/lighting-filters.svg from Inkscape distribution. The result looks more like some rat-shaped badge than an actual rat, but I'd guess, it's quite fine for demonstration purposes.<br /><br />So, enough of height maps, let's go to the actual effects. I'll start with Diffuse Lighting.<br /><br /><span style="font-weight:bold;">Diffuse Lighting</span> is, as I stated above, the light reflecting off a completely matte object. In reality, it's hard to find any such object, but cotton cloth, unpolished stones, bricks and other such materials with highly uneven surfaces come close.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixYxQrOnWYLrqpIs7Xb9JxjZp2486o5Zk4xjtfUo41hBOoLuQzU4QQXnONMsAlbOXfgUvJfD-jCYxph3P-501kGpaUB3WFu4Mv1KBGHy_x9AiG1Xbwr5DJ_cvN50NtOqzEho68AXIctgUs/s1600-h/lighting_diffuse_dialog.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixYxQrOnWYLrqpIs7Xb9JxjZp2486o5Zk4xjtfUo41hBOoLuQzU4QQXnONMsAlbOXfgUvJfD-jCYxph3P-501kGpaUB3WFu4Mv1KBGHy_x9AiG1Xbwr5DJ_cvN50NtOqzEho68AXIctgUs/s400/lighting_diffuse_dialog.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5218348246313661074" /></a><br />There's a bunch of settings for Diffuse Lighting, so let's go through them.<br /><br />Diffuse Color sets the light colour to be used.<br />Surface Scale determines, how to map the height map to actual height values. The bigger the value, the higher the peaks of height map. Also, you can move this to negative side, to turn the peaks into valleys.<br />Constant modifies the strength of the light. High constants result in harsh lighting and strong contrasts between the light and dark areas.<br />Kernel Unit Length is not yet used in Inkscape. It is used to make the result resolution-independent. Now that it isn't used, with high zooms you can see odd plateaus forming. (There's an other way around this, though it requires using XML editor. See examples/lighting-filters.svg in Inkscape distribution)<br />Light Source determines the type of light used. Available settings below that also depend on type of light used.<br /><br />The resulting image from Diffuse Lighting is fully opaque. It is best used by multiplying the colour values with the colour values of original image. This can be accomplished with Composite filter in Arithmetic mode and multipliers set as K1=1.0, K2=0.0, K3=0.0, K4=0.0. (See <a href="http://fedev.blogspot.com/2008/04/filter-effects-composite.html">Composite tutorial</a> for more through explanation of these factors)<br /><br /><span style="font-weight:bold;">Specular Lighting</span> simulates light reflecting off a smooth surface. Plastic and metallic objects often have strong specular reflections, though for really smooth objects mirror reflection can become dominating.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVNSu4gaEan0QsEusxG0lFshEzq3CRQBTOBc_6aGk5BQQGEi96pB3e1xaIyxNZ_wc-vCnUxtt38l1nn6jbhCFqrBeAGHek6vb5jC_1QVVceYu6FLiC8zg7yjjY-mvXqhkCXYqS1JYwPscC/s1600-h/lighting_specular_dialog.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVNSu4gaEan0QsEusxG0lFshEzq3CRQBTOBc_6aGk5BQQGEi96pB3e1xaIyxNZ_wc-vCnUxtt38l1nn6jbhCFqrBeAGHek6vb5jC_1QVVceYu6FLiC8zg7yjjY-mvXqhkCXYqS1JYwPscC/s400/lighting_specular_dialog.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5218354722519693650" /></a><br />Most settings for Specular Lighting are same as for Diffuse, so I'll just go through the new ones.<br /><br />Specular Color is the same as Diffuse Color, it determines the light colour.<br />Exponent is completely new here: it determines the shininess or smoothness of the object. Low values correspond to not-really-shiny objects, high values to really smooth objects. Essentially, the higher the exponent value is, the smaller and sharper the shiny spots are.<br /><br />Specular Lighting filter produces an image, that is filled with Specular Color, but opaque only where the specular highlights should fall. It is best used by adding the colour values with the colour values in the original image, or the colour values of diffuse shaded image, if you're using both lighting modes. This can be done with Composite filter in Arithmetic mode and multipliers set to K1=0.0, K2=1.0, K3=1.0, K4=0.0.<br /><br />Although the filters I've shown here have used Gaussian Blur to create the height map, this is by no means a requirement. Any image will do, though preferably one with several shades of opacity. For example, using result of Turbulence filter as height map can create interesting effects. Here, I've used turbulence to create an effect that looks somewhat like crumbled tin foil.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdzy2QPiiWD7F1JHcpISkfNRVzQJxi0FiyTXwbjF8UiGjHyKuN8wkLWyqB8ZyBwnP_I5edSfjCoE9AYCLadEGsRbmbN2ODLPsj_wrKL5PaosT7Igolw_1Hk_gYfm2QO7aDIitbwvskM0Xi/s1600-h/lighting_foil_gina.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdzy2QPiiWD7F1JHcpISkfNRVzQJxi0FiyTXwbjF8UiGjHyKuN8wkLWyqB8ZyBwnP_I5edSfjCoE9AYCLadEGsRbmbN2ODLPsj_wrKL5PaosT7Igolw_1Hk_gYfm2QO7aDIitbwvskM0Xi/s400/lighting_foil_gina.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5218360952792713170" /></a><br />The filter is available in Inkscape distribution in file examples/turbulence_filters.svgNiko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com2tag:blogger.com,1999:blog-8964583752416945383.post-8064276796312644362008-05-31T14:31:00.003+03:002008-05-31T15:22:24.667+03:00Big Buck BunnyYou may remember the <a href="http://www.elephantsdream.org/">Elephants Dream</a>, the open short movie. It was developed as project Orange at the <a href="http://www.blender.org/blenderorg/blender-institute/">Happy Blender Institute</a>. Now, a new team working on project Peach at the Blender Institute has published their work: an open short movie <a href="http://www.bigbuckbunny.org/">Big Buck Bunny</a>.<br /><br />At <a href="http://www.libregraphicsmeeting.org/">LGM</a>, I had the pleasure of watching this great movie on a big movie theatre screen.<br /><br />Elephants Dream was a technical masterpiece, showing the quality of graphics that can be accomplished with open source programs, it was somewhat lacking in the area of storytelling. While I'm guessing this dreamlike drifting to different directions was intentional at least to some degree, it just felt somehow odd to me. Maybe I just don't understand the fine art ;)<br /><br />Things look quite different in Big Buck Bunny. It's still a technical masterpiece, actually they've bumped the graphics quality up a notch or two with fur, grass and all such natural phenomena. But the bigger difference is in storytelling. This movie tells a simple story in easy to follow manner, with loads of humour. Some might think that it underestimates the mental capacity of viewers, but I digress. It's nice entertainment.<br /><br />Other interesting thing from Blender Institute is the <a href="http://apricot.blender.org">project Apricot</a>, which is creating an open source game using Blender, CrystalSpace and several other related tools. I've tried the released versions of these tools, and from what I saw at LGM, this project has made huge improvements to them. Already with the release versions, you can edit stuff like models, textures and actions between the player and scenery in Blender and export all that to the game engine. With the development version project Apricot has, it's possible to actually have the game engine running in a blender window while you can edit game data in other windows.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com0tag:blogger.com,1999:blog-8964583752416945383.post-4764175465715689082008-05-30T12:23:00.008+03:002011-04-28T12:41:01.962+03:00Fun with markers 2: FreefallA couple days ago I bumped into a great webcomic <a href="http://freefall.purrsia.com">Freefall</a>. One thing that caught my interest was how well the artist is able to express the characters' moods, reactions etc. in small scale and with just a couple lines. I decided to try and imitate that style.<br />
<br />
So, here's Florence Ambrose, a Bowmans Wolf and a technician, from Freefall:<br />
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9AYs2doxSrbctv_zys0Iyx0n-jMmi4ujR4Z-Mma95ovHXimef9N-C3lKPDDIEpnpYwoNqFcqKdMwb_A3PcUiuVbc0VmqRCOlcFi28TSiKP_rtOR8nFzzyfAjbQkUwKyj1UQ2p-XuqueLN/s1600-h/freefall_florence.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9AYs2doxSrbctv_zys0Iyx0n-jMmi4ujR4Z-Mma95ovHXimef9N-C3lKPDDIEpnpYwoNqFcqKdMwb_A3PcUiuVbc0VmqRCOlcFi28TSiKP_rtOR8nFzzyfAjbQkUwKyj1UQ2p-XuqueLN/s400/freefall_florence.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5206135477354653794" /></a><br />
<br />
While I'm not quite happy with the colours (I need more brown shades!) I think that came out quite well.<br />
<br />
For those who've been following this webcomic, finding the strip with Florence posing like that shouldn't be a hitch.<br />
<br />
Also, I noticed that there are some interesting colours in my palette:<br />
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX1KC7DbCJ5qDN4GWoEozSnCUCtvWCYwboqc_cOXFfOUF-4MUkVLn4JDAsu2_JUnhrYahmysXqmM4KD1P03ggS5_PPQSAAUcdhNbB8TTihFdNTlPKQuq5qLd-MCTeOcOHfVUGfj4iqRHOW/s1600-h/blender-orange-apricot.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX1KC7DbCJ5qDN4GWoEozSnCUCtvWCYwboqc_cOXFfOUF-4MUkVLn4JDAsu2_JUnhrYahmysXqmM4KD1P03ggS5_PPQSAAUcdhNbB8TTihFdNTlPKQuq5qLd-MCTeOcOHfVUGfj4iqRHOW/s400/blender-orange-apricot.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5206149663631632530" /></a><br />
<a href="http://www.blender.org">Blender</a>, <a href="http://orange.blender.org">Orange</a> and <a href="http://apricot.blender.org">Apricot</a>. Too bad, there's no colour <a href="http://peach.blender.org">Peach</a> in my palette nor in <a href="http://www.letraset.com/shopaff.asp?affid=42">ProMarker colour range</a>.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com2tag:blogger.com,1999:blog-8964583752416945383.post-43589457480231993622008-05-29T15:38:00.009+03:002008-05-29T16:35:09.599+03:00Filter effects: Convolve Matrix<span style="font-style:italic;">This is part of my filter effects tutorial series</span><br /><br />Convolve Matrix can be used for several different effects like blurring, sharpening, edge detection and embossing. While it's a powerful tool, it can take quite some expertise to create the desired effect.<br /><br />Inkscape support for Convolve Matrix filter primitive is not yet quite finished, but it can already be used for some work. The biggest problem is, the results will depend on the rendering resolution.<br /><br />The idea of this filter is to apply a convolution on image. Basically, it takes certain amount of pixels around the target pixel, multiplies the colour values of each pixel by its multiplier and sums them up to form new colour value for the target pixel. There also exists common divisor and bias that will be applied after summing pixel values up.<br /><br />For more through and mathematical explanations of convolutions, see <a href="http://en.wikipedia.org/wiki/Convolution">Wikipedia page on Convolutions</a> or <a href="http://www.gamedev.net/reference/programming/features/imageproc/page2.asp">article on Matrix convolution filters on GameDev.net</a>.<br /><br />Here's an graphical example with single target pixel and the 3×3 area surrounding it.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhITcf5M64haMvGYpyGLyRAxkKtFNm8BXWPFnC7NQtuvbBq_N8n9UiTzvTJCGv9nd-9N0IrEJNGl2n9Ddj35yfzDP-TezZfdXtPIXfWTUhWfNnMcr6SitQ65iSXsvIyLB4Dj3yL_gcRrXW/s1600-h/convolve_calculation.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhITcf5M64haMvGYpyGLyRAxkKtFNm8BXWPFnC7NQtuvbBq_N8n9UiTzvTJCGv9nd-9N0IrEJNGl2n9Ddj35yfzDP-TezZfdXtPIXfWTUhWfNnMcr6SitQ65iSXsvIyLB4Dj3yL_gcRrXW/s400/convolve_calculation.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5205782534122137586" /></a><br /><br />This same filter is specified in Inkscape Filter Effects dialog as follows:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiKeX2UTQ6w3NKzU7jwoCrmhztnIMbkvTJ6gezLoCHfzyTugCsSskuElvibiltAtsfHktUxrIChs8UkejEanrgZ1qqBZb-HgSPogg4mdKAn7Ec24sPf74K9-CocVZIDzbdchr9KKMjgxIS/s1600-h/convolve_calculation_screen.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiKeX2UTQ6w3NKzU7jwoCrmhztnIMbkvTJ6gezLoCHfzyTugCsSskuElvibiltAtsfHktUxrIChs8UkejEanrgZ1qqBZb-HgSPogg4mdKAn7Ec24sPf74K9-CocVZIDzbdchr9KKMjgxIS/s400/convolve_calculation_screen.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5205782903489325058" /></a><br /><br />Two special notes here: first of all, the bias is specified as 128 in the first image but as 0.5 in second image. These are actually the same thing, the first image just uses colour values in range 0–255, the second image in range 0–1.<br /><br />Second, the divisor isn't actually required. I could have specified the kernel with values of -1/8 and 1.0 and left the divisor as one. The divisor just makes specifying the values easier.<br /><br />Here are some examples of possible effects:<br /><br />Box blur:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn01UC2dyZFwCDlP_OhZabD-kec6M-aNR6K2CPjUJz6Mg0UjkszKSswihI3gStmcANr_wXznTQdw69snKNTW4qh_1Aael38yBaIn-roPKwaO132MdiVn8Zrum-qZDCiH63neQmHZSGVZIQ/s1600-h/convolve_boxblur.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn01UC2dyZFwCDlP_OhZabD-kec6M-aNR6K2CPjUJz6Mg0UjkszKSswihI3gStmcANr_wXznTQdw69snKNTW4qh_1Aael38yBaIn-roPKwaO132MdiVn8Zrum-qZDCiH63neQmHZSGVZIQ/s400/convolve_boxblur.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5205790406797191186" /></a><br />(notice though: usually it's better to use the Gaussian Blur filter primitive for blurring)<br /><br />Motion blur:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijDTQvjyNJkob_TERoBBaLfmfNK8tSKGZG8_12-oXFIy-ST3QS06p38u4UdzJfugdRR5LW1s_MatdDrcS61rGfM0uQryrqFmZdFp8GdVk_qhsGo4LzZ-3BE-TiDktGrGNLRX9u9yhovPfI/s1600-h/convolve_motionblur.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijDTQvjyNJkob_TERoBBaLfmfNK8tSKGZG8_12-oXFIy-ST3QS06p38u4UdzJfugdRR5LW1s_MatdDrcS61rGfM0uQryrqFmZdFp8GdVk_qhsGo4LzZ-3BE-TiDktGrGNLRX9u9yhovPfI/s400/convolve_motionblur.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5205790887833528354" /></a><br /><br />Edge detection:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAUCwdTThRgIYVspXF1GOlOZ1h6Z8Y5Y5AmnxQGZenCo8W0akaBVCsoeMB6ONr0ciW952And9KMtEyV2xiC-AOskTKUAOzZVd8tJAwfoGtKdc0KtacP3QRghv6_J1tMjC2Jm1My3Ro3vtv/s1600-h/convolve_edgedetect.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAUCwdTThRgIYVspXF1GOlOZ1h6Z8Y5Y5AmnxQGZenCo8W0akaBVCsoeMB6ONr0ciW952And9KMtEyV2xiC-AOskTKUAOzZVd8tJAwfoGtKdc0KtacP3QRghv6_J1tMjC2Jm1My3Ro3vtv/s400/convolve_edgedetect.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5205791020977514546" /></a><br /><br />Sharpen:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgz0DE8Xhye5dqIRGieXAPykraRvTqIUOxEWerCxwtlMz6SQpbd3xe0pzsYtDEM0h24BGZaMPLVj5a_AHszuX7zpg9yHJO-9w70jAcQnIOgLLLTqlQfn70WZxDqflV5nrPAZYH1DbA8OrGe/s1600-h/convolve_sharpen.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgz0DE8Xhye5dqIRGieXAPykraRvTqIUOxEWerCxwtlMz6SQpbd3xe0pzsYtDEM0h24BGZaMPLVj5a_AHszuX7zpg9yHJO-9w70jAcQnIOgLLLTqlQfn70WZxDqflV5nrPAZYH1DbA8OrGe/s400/convolve_sharpen.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5205791218546010178" /></a><br /><br />Embossing:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4IKAIRVPNv-LDqRJeGTLWDehahbwP36iPFLkTJ4D38gy_ceFc01Z5XpyRMMV3W2_b53OBadaSs4ftBg_BC4hQYOvmg8nxxX9KyWxeReZ5kYKQDuKNcuZRJRrILirqf1jI0JPzMPhyphenhyphen0NZJ/s1600-h/convolve_emboss.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4IKAIRVPNv-LDqRJeGTLWDehahbwP36iPFLkTJ4D38gy_ceFc01Z5XpyRMMV3W2_b53OBadaSs4ftBg_BC4hQYOvmg8nxxX9KyWxeReZ5kYKQDuKNcuZRJRrILirqf1jI0JPzMPhyphenhyphen0NZJ/s400/convolve_emboss.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5205791476244047954" /></a>Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com0tag:blogger.com,1999:blog-8964583752416945383.post-71526335176923918452008-05-22T23:38:00.002+03:002008-05-23T00:22:39.176+03:00Rant: Curly BracesI bumped into an writing called <a href="http://www.leepoint.net/notes-java/flow/if/30if-braces.html">Java: Braces are your friend</a>. While I can see that there are good reasons to use braces after every if statement (or after for, while, do...), the reasoning seemed a bit off.<br /><br />First of all, it states that the following is allowed, but dangerous:<br /><pre><br />if (condition)<br /> Exactly one statement to execute if condition is true<br />else<br /> Exactly one statement to execute if condition is false<br /></pre><br />Well, all fine and dandy and I can see where it's aiming to. The thing is, that very form is the only form that exists. The braces just serve to gather several statements up to form a single statement, they're by no means part of 'if' syntax.<br /><br />The first actual reason stated, as to why not leave the braces out, is the following situation<br /><pre><br />if (condition);<br /> do_something();<br /></pre><br />Well, OK. I can see how one can accidentally type the semicolon after the if clause. But then again... Hello, it's 2008 calling! You won't believe what cool things our program editors nowadays have. They colour the different parts of code with different colours and you know what: they even indent your code for you! Amazing, ain't it?<br /><pre><br />if (condition);<br />do_something();<br /></pre><br />That certainly doesn't look like such a big error anymore. Also, if one can go and write an extra semicolon after the if clause, why couldn't this happen as well?<br /><pre><br />if (condition); {<br /> do_something();<br />}<br /></pre><br />Even automatic indenting won't save you from that!<br /><br />The other reason is one, I think I've seen quoted a few too many times:<br /><pre><br />if (condition)<br /> do_something();<br /> do_something_else();<br /></pre><br />Yes, the old case of "What if someone later on wants to add more functionality to the if block?" Well, 2008 calling again and all that. Try writing that to any even semi-decent programming editor. It becomes this:<br /><pre><br />if (condition)<br /> do_something();<br />do_something_else();<br /></pre><br />Not so dangerous error anymore, either. You can clearly see that the second statement doesn't belong to the if block.<br /><br />Also, it crossed my mind that both these errors become invalid code, if you have an else block after that if. That's pretty much a corner case though.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com3tag:blogger.com,1999:blog-8964583752416945383.post-18702080704464714132008-05-08T11:32:00.002+03:002008-05-08T11:44:06.471+03:00LGM has begunThe <a href="http://www.libregraphicsmeeting.org">Libre Graphics Meeting 2008</a> has now begun and I'm here. I arrived yesterday and it's been a bit of a crash course to life in Poland. Stuffed buses, not having a common language with shop clerks, trying to find a place where to eat and all that. But I am now here at the conference hall and I've already have met several interesting people and heard of some completely new projects.<br /><br />For these new projects, it's now nearing to the end of presentation about <a href="http://photobatch.stani.be/">Phatch</a>, a patch editing application for images.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com0tag:blogger.com,1999:blog-8964583752416945383.post-30976673612607651632008-05-06T22:46:00.003+03:002008-05-06T23:30:00.826+03:00When PCI is not PCIThis week I bought two new peripherials for my computer: an USB 2.0 controller card and a sound card. Before you ask, yes, neither of those are integrated on the motherboard. Originally it wasn't a desktop machine but a server.<br /><br />The first problem I encountered was when I tried to insert the A-Link U2P4 USB 2.0 controller in a PCI slot. It just didn't fit. The PCI connector on the controller had different keying from the PCI slot on my motherboard. While I could have made it fit using a hacksaw or something, that didn't sound like a good idea. I didn't understand the situation at all, so I looked up the <a href="http://en.wikipedia.org/wiki/Peripheral_Component_Interconnect">PCI</a> page from Wikipedia. What I learned was, that there are several versions of the PCI bus. The card I had in my hands was built to use 5 volt signalling and my motherboard used 3.3 volt signalling.<br /><br />Further looking into different PCI versions revealed that the last version of PCI standard allowing for 5 volt only cards was deprecated already in 2004. It seems, that all new PCI cards should be able to use both 5 and 3.3 volt signalling or even 3.3 volts only.<br /><br />The second problem was with the sound card, a Terratec Aureon 5.1 PCI (aka. Fun). I was able to plug that one in, but that's just about how far I got. Whenever I tried to turn the computer on, it would turn the power on for a split second and then power off. Just enough to make the fans twitch a bit. I don't really have a way to tell for sure what's the reason, but it seems that the card was short-circuiting some of the power lines, and thus causing the power supply to cut the power.<br /><br />It may have been, that I just had an faulty card at my hands and if I exchanged it for a new one, it would have worked just fine. Also it may have been that the card is faulty by design and assumes that the signal voltage and +5 volt supplies are at the same voltage, thus shorting the +5V and signal voltage pins. What makes me to even suspect the latter is that I found notions that similar things have happened and that the sound card package showed a picture of a 5 volt only card. If the actual electronics hadn't been revised when the board was changed to universal type (both 5V and 3.3V) that's pretty much what would have happened. I already returned that card to the store for refund, so I don't have real evidence to back up that claim, so as I said, it could have just been one faulty card among a bunch of working cards.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com2tag:blogger.com,1999:blog-8964583752416945383.post-56600425229246459132008-05-02T13:00:00.002+03:002008-05-02T13:05:35.268+03:00Filter effects: Composite<span style="font-style: italic;">This is part of my filter effects tutorial series.</span><br /><br />Composite is, as the name states, an effect that can composite images together. It uses the Porter-Duff blending modes named after the writers of the paper, where it was published. For those of you with ACM Digital Library access, here's a link to the original paper: <a href="http://portal.acm.org/citation.cfm?id=808606">Compositing Digital Images: Porter, Duff</a>.<br /><br />The Porter-Duff blending modes are basically logical operations applied to images. For example, you can go and take an exclusive or of two images. In the original paper there was a table showing an example of each mode and some variation of that has been included in most places, where these modes are explained. Now that I have my two test subjects, Max the rat and Gina the rabbit, I can use them instead of boring triangles.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzjMLYZ22HQUHvu2GFz_LCxt0cjky5kgT0iCl51ZKu-8pjUxrpQWXtKKfJuFolT3ewtxQCEhTBfTv_EhhMOnMVtRV3RcB54rIbR4JL0HpDcqvGj6OBMCI2v3lsaxbqxR0sUpcYhT8UTZIA/s1600-h/composite-modes-porter-duff.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzjMLYZ22HQUHvu2GFz_LCxt0cjky5kgT0iCl51ZKu-8pjUxrpQWXtKKfJuFolT3ewtxQCEhTBfTv_EhhMOnMVtRV3RcB54rIbR4JL0HpDcqvGj6OBMCI2v3lsaxbqxR0sUpcYhT8UTZIA/s400/composite-modes-porter-duff.png" alt="" id="BLOGGER_PHOTO_ID_5195705798660526322" border="0" /></a><br />From this image, one can notice several useful relations between the different modes: over is actually the ordinary alpha compositing, out and atop are complete opposites of each other, as are in and xor.<br /><br />There is a gotcha for making this kind of images: whenever you use the Background Image you need to enable it and to remember that the filter output doesn't replace the background but instead is composited over it. So, if you just created composite filter with xor mode, you'd notice that it just seems to change the compositing order. The gotcha is that the area where the both objects are atop each other is transparent and shows through the original background. So, to make these images, I actually created a solid background inside the filter to hide the original background.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5tOFdWjrlGJ44cfhWybOwiDRVdCCeOJbbbI5vKSgEaG98xS_a2E070zkm8KwH2CR5oTEG44vZ4ySyOLzxX6j1soMCOip0fSgZBPUJ0wxMQuNDGVH6FbsR-jbU3OuqDisy8jtlzg00O_uH/s1600-h/composite_filter_dialog_flood.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5tOFdWjrlGJ44cfhWybOwiDRVdCCeOJbbbI5vKSgEaG98xS_a2E070zkm8KwH2CR5oTEG44vZ4ySyOLzxX6j1soMCOip0fSgZBPUJ0wxMQuNDGVH6FbsR-jbU3OuqDisy8jtlzg00O_uH/s400/composite_filter_dialog_flood.png" alt="" id="BLOGGER_PHOTO_ID_5195710016318411010" border="0" /></a><br />There is also a sixth mode called Arithmetic. It allows you to specify the result as linear combination of input image colours. Put other way, you can specify four constants K1-K4 for the equation (result colour) = K1 * (input 1 colour) * (input 2 colour) + K2 * (input 1 colour) + K3 * (input 2 colour) + K4. With these, you can take sum of two colours (K1 = 0, K2 = 1, K3 = 1, K4 = 0), product of two colours (K1 = 1, K2 = 0, K3 = 0, K4 = 0) and plethora of other combinations. Here are a couple examples<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipa2PaCueZ-t-7zN8nydwdPs_6bmG1qRBc3xHNAd9jWlhiFttqUdjH3klWhIaHeAf-jrJ3lkciA8R51gHFXLCEv6ODtJ2YexXZlQpmgj9KZy8OUSXjyGy87DM5rqL5MZ-I4ghNoETrv8b1/s1600-h/composite-modes-arithmetic.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipa2PaCueZ-t-7zN8nydwdPs_6bmG1qRBc3xHNAd9jWlhiFttqUdjH3klWhIaHeAf-jrJ3lkciA8R51gHFXLCEv6ODtJ2YexXZlQpmgj9KZy8OUSXjyGy87DM5rqL5MZ-I4ghNoETrv8b1/s400/composite-modes-arithmetic.png" alt="" id="BLOGGER_PHOTO_ID_5195716768007000338" border="0" /></a>Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com1tag:blogger.com,1999:blog-8964583752416945383.post-9710102881879813192008-04-28T13:39:00.003+03:002008-04-28T13:46:15.226+03:00Animal test subjectsI noticed some time ago that using five pointed stars as example material is growing a bit old. I needed something new to test these filters with. So, I came up with the idea of using animal test subjects. Here are the two: Max and Gina.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTFPY1E5wNkoEdE0nqdOtx2vzm-n5tlNmvuyJ67qr0Th4RHpaXde1TE-8fh8u5vnA9yoHD85IiJGOtTKDTeBmiQzRqnDlbjnVcBbfBnHwlwSMVdG-5C1Alx0uiOxohmhSUhi4nyMczjxuH/s1600-h/max_and_gina.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTFPY1E5wNkoEdE0nqdOtx2vzm-n5tlNmvuyJ67qr0Th4RHpaXde1TE-8fh8u5vnA9yoHD85IiJGOtTKDTeBmiQzRqnDlbjnVcBbfBnHwlwSMVdG-5C1Alx0uiOxohmhSUhi4nyMczjxuH/s400/max_and_gina.png" alt="" id="BLOGGER_PHOTO_ID_5194244968614007010" border="0" /></a><br />While animal testing can be cruel and inhumane, I promise to treat my two test subjects kindly. You'll be seeing them in new Filter Effects tutorials shortly.Niko Kiiralahttp://www.blogger.com/profile/01546970908443209152noreply@blogger.com0