Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Problem with memBlock

Author
Message
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 19th Feb 2015 22:15
I think you have to try it and see. Top left pixel is the fill area colour.

Let me know!

Onwards and sometimes upwards
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 19th Feb 2015 22:20
Top left, will do.

Will see if can check it later, wasn't sure how it detected the fill.

Cheers.

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 19th Feb 2015 23:30
I'm just handing it over the Windows flood fill routine. Want the Delphi source?

Onwards and sometimes upwards
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 20th Feb 2015 00:07
That will be good to have a look at that, going to try it later. Just drawing a test PIC

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 20th Feb 2015 05:37
Like you said Jim it went a bit weird
Wouldn't mind having a look at the code though, probably wont be able to understand it but will be interesting all the same.

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 20th Feb 2015 05:39
Anyone know if AppGameKit has any commands/features to auto anti-alias sprites to soften the edges before I start messing with my program?

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 20th Feb 2015 09:13
Paul - upload a picture and I'll see what I can do.

Onwards and sometimes upwards
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th Feb 2015 09:17
You could make a shader to simply blend the pixels from source. Like, a normal sprite render is just setting each pixel colour depending on the source image - but you could take that pixel colour, then add the colour from the neighboring pixels. The performance will be affected, but if you only sample say, the 4 side pixels then it won't be too bad, probably not even noticeable with just the 1 main sprite. One issue would be resolution, but if your using a standard or similar resolution each time, the shader can be set to work on that res - this is due to the UV mapping that sprites use, it makes it tricky to sample and blend the correct pixels. For example, if you have a 32x32 sprite, you'd sample a radius of about 0.015, but on a 512x512 sprite. that sample would need to be more like 0.001... so its tricky to make a shader for any size/resolution sprite, but real easy when you have a standard sprite size. Hope that makes sense - I'd be happy to come up with an example shader.

Anyway that way it would be fully independent - you could use solid colour images which is what I'm guessing you need.

I'm actually working on a sprite editor thing in AGKv2, basically a mobile version of the editor I use for a pixel heavy game project - I'm gonna make the first worthwhile sprite editor for tablets

I am the one who knocks...
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 20th Feb 2015 10:25
The sprites are highly irregular in shape. I'm thinking about it!

Onwards and sometimes upwards
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Feb 2015 10:48
Can you overlay the black frame? This would be black and transparent, with your smoothed anti-aliased lines. Of course you need to assess the impact on performance of another full-screen sprite.

Quidquid latine dictum sit, altum sonatur
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 20th Feb 2015 11:15
The trouble is that anti-aliasing needs to take the front and edge colours into account, and the front colour is what the users change.

Onwards and sometimes upwards
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th Feb 2015 12:23
You can assign an additional image to a sprite though, and use that in the shader - so 1 sprite, using a colour image and an overlay image. It is possible to set variables for the shader, like the UV coordinate range for blending if you use various image sizes/shapes. If the overlay image is say, just black lines with alpha, then you can just use that to affect the render, like using the alpha value to set the pixel brightness for example, rather than treating it as a full RGBA image. I'm not sure how your working, I should really read the whole thread.

I think that having more than 1 main render sprite is a bad idea - especially for Android tablets, and especially when alpha transparency is used - it would actually be far more efficient to use a shader rather than 2 full screen sprites... layering alpha transparency is something that tablets struggle with and low spec tablets choke on.

I am the one who knocks...
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 20th Feb 2015 12:56
Hi, it looks like I have opened a can of worms again!
It was just a thought to try it as I wasn't sure how the program grabbed the sprites. It is not a major headache as I am pleased with the outcome of the colouring of the sprites, I was just looking at how to improve on the app, especially now David Gervais has added some great icons

Not even sure if a white sprite with grey edges would work and if the whole sprite would still change colour and look ok. I need to test this really, was going to do it last night but by 4am I was goosed!

I thought the program may test the picture to fill by checking every pixel which was not black and then store that area surrounded by the black pixels, so putting an image through the program whould still store the same size sprites etc but include the other shaded pixels.

I was thinking back to my original program with the slow flood fill, I have a function which checked the image to do just this and was thinking about the sprite grabbing tool.

Here is the function:


I'll explain what it did:

function StoreFillPixels ( memBlockInput, img_width, img_height, colour_back )

The memBlockInput was the image loaded in and stored as a memblock, the image width and height speak for themselves, however a 2D array was created of the same size of the image after checking the width and height of the image loaded into it.
Array is - pixelStore [ img_width, img_height ]

The colour_back was the colour to check on the image as the fill colour and this was the top left pixel of the image put into the program which was always white as I never drew a black line in the top corner of the image.

The function then went through the memblock one pixel after another checking each one, the one above and the one to the left to find the fill areas, storing a value into the array.
The array ended up being filled with each fill area having it's own number and a black pixel having zero stored at that point on the array.
This wasn't very fast and as you know the fill speed was also the issue, however I was thinking if this function checked the image but instead of testing for the white pixels, it could check for every pixel other than black which would be the line, it could still store the same information but an image could be checked with shades on it for the anti-alaising.

It all got a bit too much then and I couldn't grab the areas for the sprites etc and as you know Jim the tool to do this not in the program is much better to save speed. Pre-rendered.
The other problem then is if I do manage to store the sprites with shading around the edges, then I would still need the shaded red image from the output, not shaded around the edges to check the areas in the game to colour the sprites.

Think maybe it is all getting too complicated for a program that works really well already with the routines in place now!
I might be looking into this too much

It is however a good discussion and giving lots to think about


Quote: "
I'm actually working on a sprite editor thing in AGKv2, basically a mobile version of the editor I use for a pixel heavy game project - I'm gonna make the first worthwhile sprite editor for tablets
"


That sounds like a good project you got going there, from looking around the forums recently, there is some good work coming out of AppGameKit

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 20th Feb 2015 13:04
Quote: "Can you overlay the black frame? This would be black and transparent, with your smoothed anti-aliased lines. Of course you need to assess the impact on performance of another full-screen sprite."


Missed that before, yes I thought of that but then that would add another transparent sprite but with the size of 1150 x 800 and the program runs nice and fast at the moment even on low spec mobiles which I have tested on.
Infact the only slow part of the program is the loading of the sprites from the mobile device really, but I just have a loading.... sign displayed and it is not too much of a pause to warrant a problem.

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th Feb 2015 15:32
One thing you could do, instead of filling an area, just store the colour that the area should be filled

Like, if you had a reference image for each picture, with each fill area being a different colour, you could just change that colour and store a basic colour palette for however many different fill areas your image has... then you load the palette, load the image, and convert the colours to suit your palette using a memblock and the save file would be tiny and actually generating the image would be as quick as a single scan through the memblock, a barely even noticeable performance hit.

Hehe, I feel like I'm throwing inconvenient ideas at you - it's your own fault, all this is re-firing my dusty brain from back when memblocks were added to DBPro, and all the fun we had with images then, all the techniques we came up with and ways to alter colours and fast fill with tolerances etc.

I am the one who knocks...
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 20th Feb 2015 16:24
Quote: "all this is re-firing my dusty brain from back when memblocks were added to DBPro"


Sounds like you have loads going through your head now

As it stands the program works really well with the speed of the fill etc.
What I have is a reference image as you said with each area filled in a different colour which I load as a memblock. I use this as a reference to detect which area is going to be filled in.
Once the area is checked I just change the colour of the sprite for that area.
The screen image is actually made up of many sprites set in position to look like the image, this way the fill area looks to be flood filling at a great speed but it is just changing the colour of the sprite and works great.

I have a tool now which converts an image and produces the sections into sprites with co-ordinates for the screen position for this. This was produced by Jim and means I don't have to do all this in the game, I just load the sprites and reference image into AppGameKit which have been pre-made with the tool and then put them in place on the screen and detect as above with the reference image.

The colour image size is 1150 x 800 and I tried the option of colouring in the fill area using a memblock with the reference image but it was still slow because of the screen size used, even with making the area smaller to check on the memblock using a boxed section instead of the full memblock area was slow.

The sprite method is the fastest by far.

Just had a thought in my head that during the process of creating the sprites outside of the game, that they might save with a selection of grey pixels around the edge to smooth them out but again I haven't tried yet if AppGameKit will actually change the colour of a sprite with grey pixels around the edge to look ok.
So it might not even work yet lol

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Feb 2015 16:32
Quote: " they might save with a selection of grey pixels around the edge to smooth them out but again I haven't tried yet if AppGameKit will actually change the colour of a sprite with grey pixels around the edge to look ok."


If you can save your grey pixels it will work. The closer to black they are, the less colour they will absorb. You might use (128,128,128) + (194,1294,194) on the last 2 edge pixels to blend it in.

Your biggest issue will be the algorithm to work out where to put the grey pixels.

Quidquid latine dictum sit, altum sonatur
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 20th Feb 2015 17:37 Edited at: 20th Feb 2015 17:38
@BatVink

cheers for the info at least I know the sprite grey image will work when changed colour.
I was thinking something more simpler than actually putting the pixels in after. I was thinking of putting a picture through the grab tool already with grey pixels like the simple test image here.
If you zoom into this image which I quickly drew with Windows Paint you can see there is an anti-aliasing effect however a clear black line.

So my next question and might be one for Jim as I haven't seen the code for the grab tool and not sure how it works but if you look at the function I originally wrote above to grab the pixel areas.
Could this be used to check the fill areas of an image in the tool and instead of looking for a white pixel, to look for a pixel that is not black?
So it will check the area including the grey pixels and still stop at the black line.
I am not sure then though how the sprite is grabbed and co-ordinates saved?
Also how a reference image can then be created which doesn't use anti-aliasing for the red fill areas to check with the pointer??

The function I wrote effectively creates an array with pixel values very much like the reference red image. So each area has its own number.



Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles

Attachments

Login to view attachments
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 20th Feb 2015 18:12
Here's the source:



The FloodFill() needs an edge colour. It doesn't have to have one - could use some slightly different flags, but it gets much more complicated if we mess with the colours on the borders. However it would be relatively easy to add a transition colour to each image segment later. I think!

Onwards and sometimes upwards
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 20th Feb 2015 19:46
Haha, well will have to really go through that code after printing it out because it has gone right over my head at the minute

I just ran the test picture through my function and it still grabs the areas correctly but classes the grey pixels as black, so if grabbing the white areas they will work but would be smaller and still have jaggies on the lines but just thicker lines lol

Try running this code with the picture in the zipped media folder to see if you can get what I mean that the function does. Instead of flood filling the area after running the picture through the function it prints the fill number.



Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles

Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Feb 2015 20:22
Without looking at the code in detail (currently sat in Manchester arena!) It looks like you are searching for COLOUR (e.g white).
Would it be better to search for NOT BLACK? Then you can have 254 shades of grey, and get perfect borders.

Quidquid latine dictum sit, altum sonatur
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 20th Feb 2015 20:47
Most of the code is interface setup.

Getting pixels is very slow. Using scanlines is very fast, but you need to know the exact format of a pixel - hence I force it be 24-bit, which has three byte values per pixel. TRGBTriple is an array of 3 bytes. Scanline uses actual pointers, and is thousands of times faster. The DoFills() routine is quite small.

I like your code, but it's inherently far slower than pre-computing the areas.

Onwards and sometimes upwards
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 20th Feb 2015 21:14
Quote: "Would it be better to search for NOT BLACK?"


Yes that's what I meant before but when I tried to implement it, it didn't work.
My function is not really set up to deal with it as when I put <> 0 instead of = to white it messes up because the function is essentially checking for RGB integers and not values up to 254 in one byte.


Quote: "I like your code, but it's inherently far slower than pre-computing the areas."


Cheers Jim, I wasn't thinking of going back though from pre-computing as this is the way forward the method I am using now with the sprites.
I was wondering if my function could pre-compute with shades but don't think its going to work.


Think I am going to forget about the anti-aliasing as it's too hard at this stage I think lol and keep what I have as it works well.
Just working on the oops feature now

Going to have a good read over that Delphi code though

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 20th Feb 2015 21:15
Quote: "currently sat in Manchester arena!"


Batvink, have a good time by the way whatever your watching there and stop reading these forums when you are out lol

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 20th Feb 2015 22:05
Well that was easy compared to this! Got the oops button working lol

Serious reading of code for this tonight

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 20th Feb 2015 23:14
It's not easy to look at Delphi code if you're not familiar with the way the forms design interface works. The top region of code is automatically generated. Add button to form. Move it into place. Set its caption. Then fill in what it's supposed to do if you click it.

The floodfill has two ways of working, but this is the simplest. Unfortunately it's not available in Firemonkey, otherwise this could be totally cross-platform.

Onwards and sometimes upwards
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 21st Feb 2015 01:41
Will have a good look at it and try to work it out Always up for learning new stuff

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 21st Feb 2015 02:51
If AppGameKit includes a copy memory / copy bank function ?, then doing it at runtime becomes much more viable. You'd first need to covert the image to a span list (described previously). Once you have that, then filling is nothing more than a series of memory copies. So all you do, is run through the span list (of the fill colour) and copy from a pre-filled block of colour from the one bank to the output image bank.

Example

SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 23rd Feb 2015 15:16
Hi Kevin,

yes see that thread is similar to how I started off with the reference image and then making smaller areas to check via a box section method in the fill area. I haven't tried your last method of a scan line though, will have a look at that and see how it works. You seem to just check through the image height rather than the full width and height, so that would be a loop of 800 for the height which could be made smalled with a section for the fill height instead of image height if I am reading it correctly.

Cheers

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 24th Feb 2015 22:06 Edited at: 24th Feb 2015 22:07
Question for Jim Hawkins re the sprite grabbing tool

I have just started to draw some more pictures now for the APP but the first one I have done I am having a problem with trying to get it to work.
Every time I put it through the tool I get an error message like this for some reason.



You got any ideas what this means?

I will post the image in the next message.

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles

Attachments

Login to view attachments
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 24th Feb 2015 22:08 Edited at: 24th Feb 2015 22:08
Here is the image I am trying to convert.



Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles

Attachments

Login to view attachments
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 24th Feb 2015 22:31 Edited at: 24th Feb 2015 22:32
Jim,

if it doesn't give me the error, it freezes here. Still works on the other images though. There must be something in this image it doesn't like? Can't see what though.



Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles

Attachments

Login to view attachments
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 24th Feb 2015 22:44
It's certainly in the last segment. I'll look at it in the morning. The exception is in an odd place. Too tired now...

Onwards and sometimes upwards
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 24th Feb 2015 22:55
Don't worry Jim, going to keep drawing pictures for now
It's a strange one though.

I created this picture using illustrator, then exported to .png and it is a straight 2 colour picture with no difference from the others. I even loaded it into Windows Paint and filled the areas in to try and re-save etc with Paint but still no go.

Cheers Jim.

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 24th Feb 2015 23:41


Oh dear dear Jim, sorry no need to panic!!!
Can't believe it, I have been checking and checking what could be wrong with the picture and I found it. Don't waste time looking at your program because that is 100%, 'A' okay!!

When i zoomed right in and checked all the picture there was a 1x1 pixel white dot in one of the black areas and that must have messed it up!

Sorry Jim, it really baffled me for a while but all ok!

Cheers again this tool rocks

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 25th Feb 2015 00:05
Even so - it should cope with that. It will!

Onwards and sometimes upwards
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 25th Feb 2015 00:54
😀 cheers Jim. Going at breakneck speed with the pictures now. The way I am drawing now, don't think I need anti aliasing as they are a lot smoother and look good in the App.

Watch this space!

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 25th Feb 2015 10:35
Hi, Paul

Updated version attached. The height was calculated incorrectly, so it could have zero height or width. It will now do 1 pixel PNGs!!! But it does warn if an an image is very small, and tell you exactly where is is.

Onwards and sometimes upwards

Attachments

Login to view attachments
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 25th Feb 2015 13:25
Cheers Jim, will test that tonight
Should make things a bit easier actually as I had a problem last night with another picture and it took a while to find the rouge pixel
Will be good to have the warning. Nice tool. Appreciated as always virtual beers at the ready

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 25th Feb 2015 13:34
As always, bug reports are very useful in obscure ways. The previous images were missing their bottom row of pixels. This was a problem if the height calculation was wrong - it's hard to create and scan a bitmap of zero height!

Onwards and sometimes upwards
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 25th Feb 2015 14:00
Cheers again Jim.

Got an idea in my head for a jigsaw type puzzle game which I am going to try this tool out for to break the image up into sprite pieces once I have finished the colouring book.
Once the picture is broken up I can then open them up in Photoshop and draw the image onto the pieces.
Think this will be a very usefull tool now I have found a working method of drawing the images in Illustrator and converting to PNG, you could get the sprites to really look like jigsaw pieces.

You should think about opening a new post and releasing this for the APK community and expand on it with extra features etc as this tool has a lot of potential!!

Great program.

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 25th Feb 2015 15:42
Just a bit of fun for me!

It should be relatively easy to program a system that creates jigsaw puzzle pieces from an image. I'll think about that.

Onwards and sometimes upwards
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 25th Feb 2015 16:16
Quote: "Just a bit of fun for me!"


Well amazing tool with load of potential

Quote: "It should be relatively easy to program a system that creates jigsaw puzzle pieces from an image. I'll think about that."


Great.
What I was thinking was to make a picture using 2 colours like the colouring book ones but with jigsaw piece shapes for the black lines, then once the program cuts it up and saves the IDMap and DAT file, then to load the pieces into Photoshop and draw the actual picture onto the pieces.

THINKING OUT LOUD:
If the program could have an extra drop down menu option to load in a colour picture as well as the black and white image and then pastes the picture onto the pieces after cutting or before then that would be good but not sure if this is possible?
The program could then produce the pieces in white as it does now, the MAP and DAT file as it does now, however have the option to produce coloured/textured pieces too if needed instead of white?
This could be a drop down menu option or before finishing the process a pop up button asks if you want to add a texture image to the pieces or not.

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 25th Feb 2015 17:33
@Jim

just tried the new version on the old dog picture and it works now, really like how you have got it to tell you exactly where the problem is so I can go straight to that pixel in PhotoShop or Paint and correct it without having to search all over the place.

Cheers again

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 25th Feb 2015 17:57 Edited at: 25th Feb 2015 17:58
Quote: "jigsaw type puzzle game"


This was something I was thinking of as an example. Not a great drawing but just created it lol.



Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles

Attachments

Login to view attachments
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 25th Feb 2015 19:27
I could produce a similar tool to slice a picture up into images for sprites. First we make the mask from your blank jigsaw. Then we use the reference picture (as it is now) to blit regions from a proper image onto the individual sprite surfaces.

How the bits snap together is up to you!

Onwards and sometimes upwards
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 25th Feb 2015 20:29 Edited at: 25th Feb 2015 20:44
Hmmm sounds like it would work, so then the pieces would have a texture of a picture on them? Whatever the picture would be.

It would be good if the program would also produce the same DAT and MAP file in a ZIP with the pieces.

I have got plenty of ideas for putting the pieces together, detecting sprite etc it's just creating the damn things in the first place lol

My colouring book APP is finished now and working great with the sprites, all I am just doing now is drawing extra pictures to colour so will soon be able to move onto the next APP thanks to you. I would still be struggling with the fill method otherwise

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 25th Feb 2015 22:10
There's a slight aesthetic problem with the jigsaw: really there should not be a "border" area - the pieces should "snap" together with very little in between - although I think a one pixel line would be okay. Have to look at it in practice to see - will have a go.

Onwards and sometimes upwards
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 25th Feb 2015 22:22
The lines could be made smaller, just knocked the picture up quick to show idea. A thicker line than 1 pixel is a bit more cartooney though and I am quite into that look for kids apps.
If you fancy a go at it let me know what graphics you need to test it and I will knock some more together of different types etc.

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 25th Feb 2015 22:47
What you've done is fine. The map (outline) size really should be the same as the picture. I could stretch it if necessary.

Onwards and sometimes upwards

Login to post a reply

Server time is: 2024-05-04 04:22:17
Your offset time is: 2024-05-04 04:22:17