Jump to content




Micropaint: Experimental painting program for tiny pixels


  • You cannot reply to this topic
30 replies to this topic

#1 nitrogenfingers

    Lua Professor

  • Members
  • 551 posts
  • LocationAustralia

Posted 08 August 2016 - 12:38 PM

Micropaint


A native teletext painting tool for ComputerCraft

http://pastebin.com/tMRzJXx2


What is it:

Micropaint is a painting tool that allows you to directly paint teletext characters to a canvas using a mouse tool. Details like the character code, and correct foreground and background colours are abstracted out of the program. To allow this kind of painting, the program makes use of a 'magnified' display of individual pixels, which can be edited like a normal pixel.

The program loads and exports images using the BLittle image format.

How to use it:

The program has two main windows: the canvas on the left, which represents the entire image, and the magnifier on the right, which displays a single pixel.

Using the paint tool and the colour palette, the canvas can be painted on like in any other paint program. With the magnify tool selected however, a single pixel on the canvas can be displayed in the magnified view on the right, which can then be edited for more detail work. As a single pixel can only have two different colours, updating your colour palette will update the magnify colours as well.

The image can also be resized and cropped with the box select tool. Other features, like the character code display and file options can be accessed from the menus.

Upcoming Features:

The following features are planned:

- Copy/paste tools for the selection box
- An export type that just has raw character codes and a very basic 'paint' method- a file you can copy and paste into any project without needing an API to display
- Some interface improvements, like a less terrible select box display
- A flood fill tool

Please report any other feedback or bugs in the comments or as a message. Thanks!

Screenshots:

Posted Image

Posted Image

Posted Image

Edited by nitrogenfingers, 25 August 2016 - 02:50 PM.


#2 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 08 August 2016 - 12:42 PM

This is amazing!
I love the idea of directly viewing artwork in the smaller pixel format when you are painting.

#3 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 08 August 2016 - 01:34 PM

View Postnitrogenfingers, on 08 August 2016 - 12:38 PM, said:

I have not included any other formats as I don't know enough about alternatives on the forums yet. If you know something about this, please contact me.

In terms of the teletext character images, the only other formats I'm aware of are these two.

#4 ReBraLaCC

  • Members
  • 100 posts
  • LocationSublime Text 2

Posted 08 August 2016 - 03:36 PM

looks nice, ive been searching for a program like this! :)

#5 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 08 August 2016 - 11:29 PM

Is that Pitfall Harry? Sign me up!
Cool program! I should really try to use these teletext characters more.

#6 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 10 August 2016 - 02:28 PM

This is amazing! Would it be possible to display the current character code and whether or not background / foreground are inverted? This would help anyone that doesn't want to save to a file.

Edit: A couple bugs

1) After saving and loading, all "blank" space is black
2) If you drag off the box on the right, it deselects the current character (possibly intentional?)

Edited by KingofGamesYami, 10 August 2016 - 02:46 PM.


#7 nitrogenfingers

    Lua Professor

  • Members
  • 551 posts
  • LocationAustralia

Posted 10 August 2016 - 03:25 PM

Thanks for the report, and for feedback so far. I'll keep developing this.

I can probably find space to show the character code. I've abstracted the foreground/background information out though- you just pick the colours you want and the program does the rest. For reference sake, the background is always the colour in the bottom-right corner of a magnified pixel.

1) More a fix of me not wanting to handle dynamic canvases. A later version will have options of what to fill that space with (and cropping options etc.)
2) Thanks for the catch- I'll fix this in the next version!

#8 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 10 August 2016 - 03:44 PM

View Postnitrogenfingers, on 10 August 2016 - 03:25 PM, said:

I can probably find space to show the character code.
Awesome!

View Postnitrogenfingers, on 10 August 2016 - 03:25 PM, said:

I've abstracted the foreground/background information out though- you just pick the colours you want and the program does the rest. For reference sake, the background is always the colour in the bottom-right corner of a magnified pixel.
Alright. That should work.

#9 DesertEagle-2000

  • Members
  • 20 posts
  • LocationThe Netherlands

Posted 11 August 2016 - 10:24 PM

Good job Nitrogenfingers, and thanks for accepting my suggestion! The instructions were a bit unclear but I know how to use it after a bit of experimenting.

Edited by DesertEagle-2000, 11 August 2016 - 10:25 PM.


#10 nitrogenfingers

    Lua Professor

  • Members
  • 551 posts
  • LocationAustralia

Posted 25 August 2016 - 12:32 PM

I've added a few new features, and have updated the pastebin link.

Posted Image

Toolbar
There are a few new tools which can be selected from the right-hand side. The left/right click for paint/magnify has been separated into dedicated tools, and there is also a selection box and a drag tool.
I've also made the character code available for the magnify area. It's hidden by default but you can enable it in the edit menu.

When interacting with the magnify view however, you can (and do) only paint, so you can easily switch from big screen to small when doing detail work without having to constantly swap tools.

Custom canvas sizes
You can specify a new size when creating a new canvas from the file menu. Images can also be resized from an option in the edit menu, where you can specify a new size, and which section of the image to resize from (pick the top left corner if your image is mostly there, for example).
You can also get more precise resizing controls by cropping the image using the select box. Drag out a box with that tool and select 'crop' from the edit menu. This is currently the only thing the selection box does.


This is a pretty messy snapshot but the features make this tool more feasible for asset work. Things I'm working on to improve it include:
- Copy/paste tools for the selection box
- An export type that just has raw character codes and a very basic 'paint' method- a file you can copy and paste into any project without needing an API to display
- Some interface improvements, like a less terrible select box display
- A flood fill tool

For those that have made use of the tool so far, I hope these additions are helpful, and if anyone has any requests for features or bugs to report, please let me know.

Edited by nitrogenfingers, 25 August 2016 - 12:48 PM.


#11 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 25 August 2016 - 01:17 PM

Very nice additions!
I've noticed a little bug:
When you drag the mouse with the cursor tool selected it crashes:
Posted Image

#12 nitrogenfingers

    Lua Professor

  • Members
  • 551 posts
  • LocationAustralia

Posted 25 August 2016 - 02:15 PM

Thanks CrazedProgrammer, good catch! I've updated the pastebin with a patch to fix the issue.

#13 xcrafter_40

  • Members
  • 50 posts
  • LocationIn a room with a computer, duh.

Posted 25 August 2016 - 06:34 PM

Setting the canvas size to 20 15 crashes micropaint.

#14 nitrogenfingers

    Lua Professor

  • Members
  • 551 posts
  • LocationAustralia

Posted 26 August 2016 - 12:03 AM

Interesting... I can't replicate that one. Could you send a screenshot?

#15 ReBraLaCC

  • Members
  • 100 posts
  • LocationSublime Text 2

Posted 27 August 2016 - 04:45 PM

This happened when i clicked on Crop:
Posted Image

Comes out at this function: drawMagCode()

#16 Thegameboy

  • Members
  • 21 posts

Posted 15 September 2016 - 10:17 AM

This is actually really useful! One suggestion I have, though, is to be able to work with images at least the resolution of a computer's screen. Maybe a drag tool or full screen option for easy viewing?

Edited by Thegameboy, 15 September 2016 - 10:19 AM.


#17 jakejakey

  • Members
  • 98 posts

Posted 11 November 2016 - 09:19 PM

Super useful for making neat graphics, but I've found myself in a jam. The problem is that the blittle format it uses saves in special characters, and that doesn't go well with some services (e.g pastebin) so if anyone knows how I can convert it to regular paintutils, and then shrink it with blittle, i'd appreciate it

#18 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 12 November 2016 - 01:02 AM

Off the top of my head, versions of ComputerCraft which work with BLittle will also let you upload/download non-ASCII to the likes of pastebin without issue.

That said, you should be able to use the BLittle API to load a given image into a table, textutils.serialise() to get that as a string, then textutils.urlEncode() to make it completely web-safe.

#19 apemanzilla

  • Members
  • 1,421 posts

Posted 12 November 2016 - 01:37 AM

View PostBomb Bloke, on 12 November 2016 - 01:02 AM, said:

Off the top of my head, versions of ComputerCraft which work with BLittle will also let you upload/download non-ASCII to the likes of pastebin without issue.

That said, you should be able to use the BLittle API to load a given image into a table, textutils.serialise() to get that as a string, then textutils.urlEncode() to make it completely web-safe.

Nope, bytes >127 still get replaced with a ? when uploading or downloading via the HTTP API.

#20 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 12 November 2016 - 02:09 AM

Hmm, testing it out I'm seeing mismatches, but not throughout the entire >127 range. It affects the teletext characters and that's pretty much it!

I can confirm, though, that textutils.serialise() already escapes everything that needs to be escaped. No need to additionally call urlEncode().





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users