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 Gradients saved to PNG

Author
Message
Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 20th Feb 2014 02:53 Edited at: 20th Feb 2014 03:04
I wanted some gradients and being a programmer not an artist, wrote a little code to provide a selection.

On screen they looked fine, but when I checked the file saved, there are visible blocks of colour where the gradient isn't.

(this is the original untouched image saved)
Don't know if it's the image encoding or something else so the first step is to confirm it's not my system.

I compiled and run on 108.19,108.20 and 108.21, the images look the same.

Any ideas before it goes to the bug board?

Thanks in advance

Edit: Typo in code

Attachments

Login to view attachments
Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 20th Feb 2014 02:57 Edited at: 20th Feb 2014 03:59
..and this is a screen grab (so its drawing it ok)

Notice the gradients look smooth and not block like in any way.

Edit:

Sprites rendered with the grabbed image exhibit the same blocks of no gradient, suggesting an issue with getImage() not getting all the image

Logged as Issue 628;
https://code.google.com/p/agk/issues/detail?id=628

Attachments

Login to view attachments
MASTER OF PUPPETS
20
Years of Service
User Offline
Joined: 9th Jun 2004
Location: Trapped Under Ice
Posted: 20th Feb 2014 05:05 Edited at: 20th Feb 2014 05:07
It came out fine for me. Are you clearing the screen before getting the image? I Modified the code slightly for easy viewing and exiting.

My understanding is that the 'GetImage' command grabs everything inside the specified x,y pixel range from the backbuffer. If there is something else being drawn, this could be the issue.

This is the setup file:



...and this is a modified version of your snippet:



I've attached the image that this generates for me as cross-reference.

|,,|, (Dead Knot Broken) ,|,,|

Attachments

Login to view attachments
Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 21st Feb 2014 15:16 Edited at: 21st Feb 2014 15:17
Wierd.

I reused the code in a new project - no changes, exactly as original line for line - and the problem did not recur.

As such, I'm putting it down to something rotten in the project I was using.

Thanks for checking MASTER OF PUPPETS, I've updated the bug board and request the issue be closed.

(delay in responding due to lost internet for last 24hrs)

So, if anyone wants some gradients, here's the latest one I did.


(Hmm pure gradients )

Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 22nd Feb 2014 10:48
I think I can see what the problem was.

From 0.25 to 0.5 of the way up the image (from the bottom) it looks like you had a rectangle sprite across the image. Perhaps it was grey or white, and almost transparent. It has slightly discoloured what was beneath it?

Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 22nd Feb 2014 12:55
It certainly looks like that, but the strange thing is that there should have been nothing at that position - certainly I didn't put any sprites there.

There were other sprites on screen, a line 2 pixels high which touched this near the very bottom - you can just see a tiny part to the right of the magenta strip on the screen grab where I cropped the image one pixel too wide - but it's tiny, nowhere near high enough and the draw command were over the top and completely opaque anyway.

The only other difference was that the original was scaled, the new version used native resolution, so it may be a side effect of that.

Login to post a reply

Server time is: 2024-11-25 03:07:06
Your offset time is: 2024-11-25 03:07:06