Projects
![]() | This is a picture of my eye. But it’s interesting because it is, in fact, a collage of smaller images that were assembled by a program I wrote in Python and C++. I wrote this program because of a shortcoming in existing software: it selects the best smaller image to use by averaging the pixels beneath it. If you have a space that is black on one side and white on the other, existing software will simply use a grey image as a middle ground and call it a day. I think that makes the final image much worse, so I wrote this to use 64 pixels underneath each image and pick the best one it can. It seems to me that my code is extremely good at representing hair, and in this case my eyelashes. So it actually operates as a kind of upscaler—if you have enough input images, then the result becomes very, very good.View code on GitHub |
| This video is made using the collage software from above, and I was quite surprised that it got a quarter of a million views. Each second of video is 24 different frames, and it runs for over two minutes, so it was running overnight to finish generating. I had to implement a lot of efficiency improvements from doing a single image, such as using C++ multithreading called from python code. I did try multithreading python code, which you might think is impossible, but you can multithread python when it comes for fileIO, just not executing python itself. This is the main thing that slows down the code, but C++ was even faster actually using pointers to memory locations of the matrices I needed.View code on GitHub | |
![]() | This is a gas/electricity usage graph that I wrote the backend for that is shown on the Genesis Energy App and Frank Energy app. It uses a Node.js microservices backend and follows a backend-for-frontend design philosophy. An interesting point to consider with this graph is how the kWh graph compares to the dollar value version of the graph. Which you might expect them to have identical bar heights as you pay a certain dollar value per kWh. But in New Zealand we also have a daily fixed cost of electricity which is usually a couple of dollars. So the relative cost for each day of electricity measured in dollars is less than that of kWh. If you don't use any kWh of electricity, you still need to pay the fixed cost so the bars will always seem closer together. I am not sure any customers would notice that but it is interesting. |
![]() | There is so much excess colour information in JPGs that is not very noticeable, so in this image I realised that you can use that space to instead hide a message. If you take the R, the G the B values, each an integer from 1-256 and take it modulo 26, you can then add the ASKII values of a character - 96. (The ASKII value of a). So each pixel can hold three letters. I thought that this was quite an interesting way of hiding a message, to send someone. Of course if you have a message that you need to be un-crackable there are algorithms that you can use. So this would be more appropriate as something hidden in plain sight, or something you want found. |
![]() | I took part in a hackathon where we had data from Maxus and 24 hours to process it to get a result. It was a really interesting and exciting experience and our team ended up here. It was interesting to be able to process infra-red light that our eyes could not see to provide insights. |
![]() | You may or may not know that you cannot express the perimeter of an ellipse as a function of its width and its height using a polynomial. This fact was very interesting to me when I was 18, combined with the concept of evolution inspired algorithms. So what this code does is it creates various different polynomial functions that take in a width and a height and return a perimeter. I could destroy the ones that got it very wrong, and replicate and mutate the best ones. Each generation would use various random ellipses to evaluate the different polynomials for how good they were. This sounds complex, but is quite straightforward to code. And interestingly enough I did get a decent result out of it. In theory though, as an ellipse approaches infinite in size, your polynomial will also get more and more wrong. So its difficult to really evaluate how good my algorithm is as compared to other famous mathematical functions that have been made to answer the same question. Its just a matter of arbitrarily deciding the maximum size of ellipse you care about.View code on GitHub |




