Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

The Space Shuttle Endeavor is a kit from the aviation line of Metal Earth models. When I first looked at this kit it looked like it would be a challenge to put together, but upon opening it I was surprised to see just a single sheet and only a dozen or so pieces. Still, despite its simplicity, the kit was fun and satisfying to put together and looks quite nice.
IMG_1229.jpg


As always I used the usual set of tools to put this kit together. Inside the kit was a single sheet of laser cut metal parts and a single-side instruction brochure. Did I mention that this kit was super easy and quick to put together?!

IMG_1215.jpg IMG_1216.jpg


The body of the shuttle required some major bending, I used a pen to get it into the correct shape, then it was a bit of hand bending to get everything fitting together and looking nice.

IMG_1217.jpg IMG_1218.jpg


I don't usually like the cylindrical pieces because they are a bit of a pain to get right and this was no exception. At least they weren't tiny like on some kits, but there were quite a few of them required for the engine section.

IMG_1220.jpg IMG_1222.jpg


Continue reading...  

, ,

Two weeks ago I wrote an article - Hijacking HTML canvas and PNG images to store arbitrary text data, this is the complimentary article that deals with extracting data back out of these images. As a summary, in the first article I described how arbitrary text data (or JSON in my specific case) could be stored as pixels in a PNG image. This required converting input data from JavaScript's Strings to a Uint8Array and then storing bytes using three channels (RGB) within an ImageData object before drawing this image to a Canvas and saving as a PNG file. So lets see what's involved in doing the reverse of this process and getting back the original data...

At the end of the last article we had an image that looked something like this...
pngdata_3.png


This image stores a serialised JSON object that has 3700 indexed properties each holding a String value 'The quick brown fox jumps over the lazy dog'.

Loading the Image

The image is loaded by creating an Image object and setting its src attribute to the PNG image from the previous article. In a real use case the src attribute can be set or a URL or even a data URL. This example keeps it very simple and references a file.
 JavaScript
var img = new Image();
img.onload = function() {
...
};
img.src = 'image.png';


The onload() callback will be where all of the decoding code goes, for now this is an empty function which will be filled out in the following sections.

Drawing Image to Canvas

Once the image is loaded we need to access its pixel data which means it has to be drawn on an off-screen canvas first. A canvas with the same dimensions as the image (assuming everything is square) is created and the image is then drawn to the 2D context.
 JavaScript
var imgSize = img.width;
var canvas = document.createElement('canvas');
canvas.width = canvas.height = imgSize;
var ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0);


Continue reading...  

, ,

For my other website, Atari Gamer, I tend to have to process quite a few images that I find online. I use GIMP for most of this and typically work with the Rotate Tool and the Perspective Tool. I've been using the same version of GIMP for a number of years now (version 2.8) and have always found it to be clunky and slow. For some reason it didn't occur to me to upgrade until today, and I'm really glad I did!
gimp.jpg


The 2.10 version is a huge performance improvement over the previous version that I've been using. Both the Rotate and Perspective tools can be used in real-time and no longer make it feel like you're running GIMP on a prehistoric computer. The tools are snappy and responsive, just like they should be.

I can't say that I really like the new interface (hence the change back to the old icons and the light theme). The other negative is that single-window mode still feels slow when the window is being resized. Overall though, this is a huge improvement.

Continue reading...  

, ,

Two and a half years after the issue was logged to make it possible to show private repository contributions, GitLab has finally come through and made it possible! I've been following this issue closely and have covered its non-movement in the past. I've grown rather disillusioned by the constant delays, so today I was utterly shocked (in a nice way) when I checked GitLab and saw it was finally merged.
gitlabpriv_4.png


Hooray!

So what does that mean? Well I can turn my public profile page from looking barren like this...
gitlabpriv_3.png


To a more respectful version like...
gitlabpriv_2.png


This works by showing stats of all of the private repositories in the public profile page. A very much needed option in my opinion.

It's activated from Settings > Profile > Private contributions. Tick the 'Include private contributions on my profile' and all the stats for the private commits and issues, etc will be shown in your profile. Perfect!

Thanks to the GitLab team for finally making this possible!

Continue reading...  

, ,