18-bit RGB palettes are an old format used by VGA displays of yesteryear. These palettes use 6-bits for each of the red, green and blue channels and usually allowed a maximum of 256 colours from the 262,144 unique colours available. This article describes how to read and write 18-bit palette files.

Continue Reading

Some time ago, I used the Bing Translator API to help create localization for some of our products. As Microsoft recently retired the Data Market used to provide this service it was high time to migrate to the replacement Cognitive Services API hosted on Azure. This article covers using the basics of Azure cognitive services to translate text using simple HTTP requests.

Continue Reading

One of our internal tools eschews XML or JSON configuration files in favour of something more human readable - YAML using YamlDotNet. For the most part the serialisation and deserialisation of YAML documents in .NET objects is as straight forward as using libraries such as JSON.net but when I was working on some basic serialisation there were a few issues. This article describes how to use the IYamlTypeConverter interface to handle custom YAML serialisation functionality.

Continue Reading

At the start of 2014, I published an article describing how to read colour palettes from BBM/LBM files. At the end of that article I noted that Microsoft palette files used a similar format, but I didn't investigate that at the time. Since then I followed up with articles on reading and writing Adobe's Color Swatch and Color Exchange format files and I posted code for working with JASC, Gimp and other palette formats.

Now, finally, I decided to complete the collection and present an article on reading Microsoft's palette files.

Continue Reading

Previously, I've described on this blog how to do a basic integration of NDepend with Jenkins pipeline jobs. The disadvantages of the previous post was it was essentially part of a series tailored to our build process and so not easy to view as a stand-alone article and it only covered pipelines. This complementary post covers how to perform the same level of integration with a freestyle project.

Continue Reading

One of the security features of Jenkins is to send Content Security Policy (CSP) headers which describes how certain resources can behave. The default policy is extremely restrictive which can cause problems with content added to Jenkins via build processes. This post describes how to either temporarily or permanently change the CSP to be less restrictive.

Continue Reading

I've recently been updating our series on dithering to include ordered dithering. However, in order to fully demonstrate this I also updated the sample to include basic color quantizing with a fixed palette.

While color reduction and dithering are related, I didn't want to cover both topics in a single blog post, therefore this post covers finding the nearest color via Euclidean distance.

Continue Reading