[SOLVED] Semi-transparent images importing as totally transparent

Started by cipberbloom, Fri 09/07/2021 00:49:15

Previous topic - Next topic

cipberbloom

Greetings everyone!

Every png I import into AGS that has a 'large' semi-transparent section (could be 1 pixel, could be 1000 pixels) just shows as completely transparent, and yet alpha is recognised on the edges of all of the others, rendering them nice and anti-aliased. These images are fine when viewed in image viewers or editors on my computer, tablet etc. Is this a known issue? I wasn't finding anything in the forums or Discord.

Here is my sweet html 4 demonstration  ;) with an 80% transparent background square with black dots, and an anti-aliased save sprite.

[imgzoom]http://www.invisibleprocess.com/images/screenshot_transparency.png[/imgzoom]


Thanks in advance!





Cassiebsg

Just to make sure we cover the obvious guilty parties:
- Make sure you are importing the image with "Import alpha channel", and that you have set the transparent colour to Leave as-is.
- Make sure that in General Settings, under visual you have the sprites and GUIs to use Proper alpha blending.
- And of course, that the sprite has alpha. (but you kind have already said it does).

Also, note that in the editor you can't see alpha (sorta), so I'm assuming that the problem with the lack of semi-transparency is in game and and not just in the editor.

Hope it helps, otherwise someone more knowledge will surely come with other possibilities. 
There are those who believe that life here began out there...

cipberbloom

#2
Quote from: Cassiebsg on Sat 10/07/2021 00:31:08
Just to make sure we cover the obvious guilty parties:
- Make sure you are importing the image with "Import alpha channel", and that you have set the transparent colour to Leave as-is.

That was it ('Leave as-is')! One of those cases of me staring at the editor like a zombie, but not seeing what is actually on the screen. (laugh) How many hundreds of sprites have I imported by now?  :-\ 

Thank you once again!

Cassiebsg

QuoteHow many hundreds of sprites have I imported by now?

Just in case you haven't found it, you can "batch re-import" sprites from source. Since AGS keeps the last setting you used to import a sprite, all you need is to re-import one and then batch away. :D (One sprite folder at a time, though).
There are those who believe that life here began out there...

Crimson Wizard

Quote from: Cassiebsg on Fri 16/07/2021 17:06:47
Just in case you haven't found it, you can "batch re-import" sprites from source. Since AGS keeps the last setting you used to import a sprite, all you need is to re-import one and then batch away. :D (One sprite folder at a time, though).

That's not how it works... "Replace sprite from source" uses exactly the settings you used when importing this sprite for the first time. So it will just reimport same exactly way again.

What would be useful here is a command "replace sprite(s) from source using new settings", but we don't have it.

Cassiebsg

What? I've used it countless times and had never encounter that.  ???
I'm confused now.

EDIT: Okay, I checked... 3.5.0.23, with the new import system, doesn't do that.  :~( However, 3.4.0.13 does! So it seems like you guys broke the import system for the batch import, IMHO. Guess I just never had to use this with 3.5 before, so hadn't noticed the change.  :(
There are those who believe that life here began out there...

Crimson Wizard

Quote from: Cassiebsg on Fri 16/07/2021 23:04:54
EDIT: Okay, I checked... 3.5.0.23, with the new import system, doesn't do that.  :~( However, 3.4.0.13 does! So it seems like you guys broke the import system for the batch import, IMHO

I don't think it's broken, it probably was wrong before, because it's not correct to reimport all sprites with the settings from a first one without a warning, as some of these sprites may need different settings.

Such operation would need an explicit instruction from user.

So we just need to figure out a convenient form and add one.

Cassiebsg

Okay, lets agree to disagree then.  :)

That feature has saved me a few times before, and it wasn't that  hard to fix if I accidentally re-imported some sprites with the wrong setting. It was just the trouble to re-import one and change the setting, then re-import all I accidentally broke. The way it is now, only solutions I can think of, is deleting all, and then re-importing them with new settings (being careful to import them into the same slots), or manually change the setting for each and every one... depending on how may they may be, can be a major headache. Fortuna I only use real-alpha and leave-as-is. So as long as I import my first correct, all others should be imported correctly.

But I agree, that it should have given a warning (as I did that mistake on my first game, and then wondered with am image had transparent BG where there should have been none... but I fixed it rather fast ;) and learned how the import/re-import worked).

Maybe a GUI displaying "Warning: You are about to change one or more sprites setting!" and two options: Cancel and Proceed anyway, would solve the problem without having to add more import options? This way the dev. could just cancel and make sure all the sprites selected should be changed.

There are those who believe that life here began out there...

Crimson Wizard

The old behavior is very unexpected, and quite possibly a never intended effect of this command. Simply the fact that you have to "prepare" it for use by doing "first time right" already illustrates how weird it is.

With warnings or not, but there should be enough commands to cover major use cases. If there were only old behavior, even with a warning, it would still leave a person not knowing what to do if it was not their case.



EDIT: By the way, in 3.5.0 it's possible to change sprite's import settings in its properties. If you do that for all necessary sprites, then you may perform "replace from source" over all of them.
In an abscence of a proper command for such reimport, that may be slightly faster than doing full "Replace from file" (with selecting a file, options, and clicking Import every time).

Cassiebsg

I noticed that, but one still needs to go one by one and change it, I'm guessing.

Quote
Simply the fact that you have to "prepare" it for use by doing "first time right" already illustrates how weird it is.

That's also true, I think the first time I used it I expected the settings panel to show up.

On another note, why does one even have to select transparent colour, if one has selected Import alpha channel?
I think it should automatically select Leave-as is and grey-out remaining options. I'm assuming that if one wants to import alpha transparency, then the transparency is set by the alpha, and thus no needs to select transparent colour. And if one wants to select the transparent colour, then deselecting Import alpha channel should be needed...

(But we're probably getting way OT discussing this in here. Maybe a split thread would be in order?)
There are those who believe that life here began out there...

SMF spam blocked by CleanTalk