pedrosgali 8 Posted July 10, 2014 Share Posted July 10, 2014 **UPDATED** ++Now With Image Lib!!++ DrawPlus - http://pastebin.com/3CKz7MDy Image library - http://pastebin.com/yxCUs4hw Call this program with a filename, a width and a height eg: paintPlus myMasterpiece 100 50. You can leave the numbers out if you are calling a previously saved picture eg: paintPlus myMasterpiece The image library goes in your /lib folder and is used just like this: local img = require "imglib" --or whatever you called it.. local data = img.load("/Images/yourImage") img.draw(data, x, y) --x and y being where you want it. All images loaded by the image lib will be compressed to save your precious RAM. I got it down to about a third of the size of the image! "Lets paint a happy little tree here" - Bob Ross. Features: Menu: This is a menu to navigate the features. right click anywhere to toggle visibility of the menu. Palette: Supports up to 99 palettes of 9 colours (more slots than there are colours by far.) use the screen buttons < > to navigate the active palettes or use "New" to add a palette to the end of the list right click on a colour in the palette to bring up the RGB chooser. RGB cooser: 3 sets of buttons to control the RGB. click "Ok" to apply or "Exit" to cancel. Save: Does what you think it does. Load: Brings up the file browser to select a different masterpiece. Tools: Gives 4 basic tool types, Brush. Edit brush size x and y Line. Click once to set start point then again to set end point. Box. Click once to set start point then again to set end point. Circle. edit radius and choose filled or hollow. Layers: Brings up the layer menu. Use "New Layer" to add a new layer to the image. All pixels in the new layer will be set to transparent initially. Click on a layer number to change the active layer and press the red "H" to show a layer or the green "V" to hide a layer. Each page only shows up to 10 layers so use "<" and ">" to switch pages. if you make a mistake on a layer then press "Trans" to toggle transparency as the active colour. Animate: Hit "Play" to go through each cell layer by layer. Hit "Loop" to have it loop. Click on the screen again to stop playback. Quote Link to post Share on other sites
pedrosgali 8 Posted July 14, 2014 Author Share Posted July 14, 2014 Updated to add tools. Next update (Hopefully next week depending on work) will include multi layer images and a basic animation editor. =) Quote Link to post Share on other sites
pedrosgali 8 Posted July 18, 2014 Author Share Posted July 18, 2014 Updated to add Layering and animations A note on animations: After a bit of testing I have found that animations that run smoothly are a balancing act between image size and the overall complexity of the image. Full screen is completely out of the picture, I designed these animations to be played in "windows" as a game dev tool. (Watch this space.) The largest I have tried so far is 30 x 15 and managed about 4 fps. I am working on a new render method at the minute which is faster but a bit buggy so I've posted the stable but slower version. The next update will have a render compiler and a stand alone player as I have noticed that these animations can get quite big. That 30 x 15 with 21 layers came in at 313.5K! Quote Link to post Share on other sites
Molinko 43 Posted September 5, 2014 Share Posted September 5, 2014 This is really awesome!! nice work! Quote Link to post Share on other sites
Izaya 19 Posted October 11, 2014 Share Posted October 11, 2014 Any chance we could get an API or something for rendering images outside of the program? I have uses for such things. Quote Link to post Share on other sites
pedrosgali 8 Posted April 17, 2015 Author Share Posted April 17, 2015 Hey guys, been away for a while. I'll post an API for displaying the images as stand alone data later tonight, didn't really think about it at the time lol. Quote Link to post Share on other sites
Molinko 43 Posted April 17, 2015 Share Posted April 17, 2015 Hey guys, been away for a while. I'll post an API for displaying the images as stand alone data later tonight, didn't really think about it at the time lol. Welcome back Quote Link to post Share on other sites
Molinko 43 Posted April 17, 2015 Share Posted April 17, 2015 Hey guys, been away for a while. I'll post an API for displaying the images as stand alone data later tonight, didn't really think about it at the time lol. Welcome back Quote Link to post Share on other sites
pedrosgali 8 Posted April 17, 2015 Author Share Posted April 17, 2015 Thanks man. I've been asked to start an after school club to teach kids the basics of programming using minecraft, just been looking through my old code to see what I can salvage. Quote Link to post Share on other sites
Molinko 43 Posted April 18, 2015 Share Posted April 18, 2015 That's great man. Sounds like fun. Lemme know if I can be of service Quote Link to post Share on other sites
pedrosgali 8 Posted April 22, 2015 Author Share Posted April 22, 2015 Hey guys, finally added the library for calling images yourself. Sorry it took so long but I wrote a new compression method that will save you a lot of RAM, this is done automatically on loading an image. It also required a new render method which is only marginally faster but still a little faster. Happy painting Quote Link to post Share on other sites
Slaughters 0 Posted August 10, 2015 Share Posted August 10, 2015 Upside down thumbs down. This is nice, I wish Operating Systems for Open Computers had so good layouts, like the Hologram Editor. Quote Link to post Share on other sites
pedrosgali 8 Posted August 15, 2015 Author Share Posted August 15, 2015 Thanks man, I used the library from this to make Minejaro. It's a front end GUI for openOS, if you like the style of this you should check it out. It needs looking at again really but I rarely have time these days. Quote Link to post Share on other sites
Log 16 Posted August 30, 2015 Share Posted August 30, 2015 Why the pixels are not square? local component = require('component') local event = require('event') local gpu = component.gpu local color = 0xFF0000 local tSize = {gpu.getResolution()} local function clear() gpu.setBackground(0x000000) gpu.setForeground(0x000000) gpu.fill(1, 1, tSize[1], tSize[2], ' ') end clear() while 1 do local e = {event.pull()} if e[1] == 'touch' or e[1] == 'drag' or e[1] == 'drop' then local pixel = {gpu.get(e[3], e[4])} if e[5] == 0 then gpu.setForeground(color) gpu.setBackground(pixel[3]) gpu.set(e[3], e[4], 'â–„') elseif e[5] == 1 then gpu.setForeground(pixel[2]) gpu.setBackground(color) gpu.set(e[3], e[4], 'â–„') end end end Just an idea Quote Link to post Share on other sites
kevinkk525 8 Posted September 4, 2015 Share Posted September 4, 2015 Awesome program. Can you release this program on github? I'd like to integrate this program and imageLibrary in my GUI-API but therefore I'd need one feature: Drawing of a specific area of the image And can you add a menu to save the file with a filename? And maybe an exit-button? And i found a bug that should be fixed: as soon as i press any key the program just exits.. I can't insert any char into the image. Quote Link to post Share on other sites