Handling Transparency
Moderators: Programmer, WebWeaver, WillowsHeart
-
- Major Contributor
- Posts: 196
- Joined: Tue 01 May, 2007 3:11 pm
Handling Transparency
Hi, this is a separate issue and I don't think its a fault of Orphalese but of the "Graphic Subsystem" or of the GIF format used for Transparency.
Around ANY transparent card there is a thin line of single pixels which are white. This is a big shame and spoils the effect considerably!
Wouldn't it be nice if the GIF file allowed a per file selection of the colour which the "Graphic Subsystem" used to fill in this single pixel "Edge"! This would be a considerable enhancement and would presumably help in many other situations. It would be a good "Feather in the Cap" of anyone who could come up with such an enhancement to the file type?...
Then one would just have to wait till Graphics Programs were updated to use said enhancement....
Just a thought.
Greg the Yeti
Around ANY transparent card there is a thin line of single pixels which are white. This is a big shame and spoils the effect considerably!
Wouldn't it be nice if the GIF file allowed a per file selection of the colour which the "Graphic Subsystem" used to fill in this single pixel "Edge"! This would be a considerable enhancement and would presumably help in many other situations. It would be a good "Feather in the Cap" of anyone who could come up with such an enhancement to the file type?...
Then one would just have to wait till Graphics Programs were updated to use said enhancement....
Just a thought.
Greg the Yeti
- Programmer
- Major Contributor
- Posts: 1725
- Joined: Sat 01 Jan, 2005 12:00 am
- Location: Spain
- Contact:
Re: Handling Transparency
If I am understanding you right, the white border appears on the image itself, so if you open it in a graphics program you can see it too. Or is it that the white border only appears when you use the image as a card in the Orphalese Tarot? I normally use Paintshop Pro for any graphics work and I have never had that happen to me. If you like you could send me some of the cards from the deck (using the administration address at orphalese.net) and I will see if I get the same phenomenon happening on my computer.
-
- Major Contributor
- Posts: 196
- Joined: Tue 01 May, 2007 3:11 pm
Re: Handling Transparency
No, in response to your question, the white jaggy line only occurs when using the cards in Orphalese.
Putting a red background (for contrast) behind within CorelDRAW shows that there is absolutely no white line, jaggy or otherwise. I would not expect that in a Vector Graphics Program...
For my next project, the I Ching Decks I've called "Clear Advice" (a pun on transparent) I followed your advice on the forum and used the png file format and a pure white background. This produced a perfect result with no white line or "jaggies"! Brilliant!
So I tried that on the Euro Millions Ghostly Medium Deck. No luck! Same white jaggy line. Damn!
Perhaps it was that the I Ching Decks have ONLY horizontal and vertical lines, allowing a perfect pixel result?
This makes me think that perhaps it is in the conversion from Vector Graphics to a pixelated format that's doing it?? Ironically the Vector Graphic format has NO "jaggies" and is scalable with no loss of clarity. (I also find it brilliant to work with...). It's the Pixel formats that have the "jaggies.
I will try using Corel's Photo Paint (I don't have Paintshop Pro), but Photo Paint should produce results just as good... I'll let you know
Regards Greg
Putting a red background (for contrast) behind within CorelDRAW shows that there is absolutely no white line, jaggy or otherwise. I would not expect that in a Vector Graphics Program...
For my next project, the I Ching Decks I've called "Clear Advice" (a pun on transparent) I followed your advice on the forum and used the png file format and a pure white background. This produced a perfect result with no white line or "jaggies"! Brilliant!
So I tried that on the Euro Millions Ghostly Medium Deck. No luck! Same white jaggy line. Damn!
Perhaps it was that the I Ching Decks have ONLY horizontal and vertical lines, allowing a perfect pixel result?
This makes me think that perhaps it is in the conversion from Vector Graphics to a pixelated format that's doing it?? Ironically the Vector Graphic format has NO "jaggies" and is scalable with no loss of clarity. (I also find it brilliant to work with...). It's the Pixel formats that have the "jaggies.
I will try using Corel's Photo Paint (I don't have Paintshop Pro), but Photo Paint should produce results just as good... I'll let you know
Regards Greg
- Programmer
- Major Contributor
- Posts: 1725
- Joined: Sat 01 Jan, 2005 12:00 am
- Location: Spain
- Contact:
Re: Handling Transparency
Ok, I don't have any experience with vector graphics so I don't know how that might affect things. Just to clarify one point though, it really shouldn't matter what file format the images uses as long as it is one that the program recognises. In fact it doesn't even need to support transparency. The program applies the transparency to the deck (which is a program window, just without a caption bar and maximize and minimize buttons etc.). People are used to seeing rectangular windows, but some program use non-rectangular ones, for example if you set Windows Media Player to use a skin it will probably be non-rectangular. The program could make the deck partially transparent even if it wasn't showing any graphic at all. The question is though, which parts of the deck to make transparent? It gets the clue by looking at the very top left hand pixel of the image it is going to show, the very first pixel in the image. In your deck it is white, but it could just as well be bright red or bright blue (it is always best to choose a pure colour). Then the program maps all the areas on your image that are that color (which should be all the empty areas around the number etc.) and then applies that map to the window itself, making the window itself transparent in those areas. So the image could be a bitmap or anything, it is getting an exact color match that is important. If the first pixel in your image was pure white (255,255,255), but for some reason around the edges or anywhere else you hand some apparently white pixels (255,255,254 for example), then these areas would not be transparent. That could give rise to the kind of white line you are describing.
-
- Major Contributor
- Posts: 196
- Joined: Tue 01 May, 2007 3:11 pm
Re: Handling Transparency
Thanks for your reply.
Its interesting that it is using the relatively new Windows function of irregular shaped windows!
But this of course means that a resolution will be hard to achieve, since Microsoft like making feedback about as difficult as swimming upstream in a raging torrent!
If I'm right, Orphalese doesn't currently support Vector Graphics formats?
If that one thing could be added it would boost the potential for really perfect graphics!
I've been using CorelDRAW for many years, for both serious and lighter weight stuff. If you know how it works, it is a very effective Desk Top Publishing tool. No need for the limitations of Microsoft Publisher or Serif's equivalent. CorelDRAW can do everything they can and more, giving you greater freedom of expression!
Vector Graphics can import pixel images, but the actual vector parts of the image are pure and simple. I.E. if the background is white - 255, 255, 255 - then it is all pure white - guaranteed!
PLUS the lines around areas that you define are as smooth as your "Node Editing Skills" allow them to be. (The fewest nodes give the smoothest edges! eg a circle or oval can be defined by just two "nodes")
If Orphalese could be made to handle the Vector EPS format, that wold be absolutely brilliant. Both CorelDRAW and Adobe Illustrator can export to that standard Vector format. (Also many of the 3D programs can export to EPS files as well!)
Other advantages for designing Orphalese Decks are that working with a Vector File allows the re-editing of the Deck much easier. In some situtations (like those Lottery Decks) it makes the creation of the Cards MUCH quicker!!
It looks to me very much like Dominatrix has used Vector Graphics for many Decks...
I'm not sure what would be required? Would it be just the inclusion of a single dll for conversion? (It might be a "pay for" option of course! Then it's just a question of it's value...)
Then again, it may be that Windows wouldn't accept or allow it.....
If you're able, I for one would be very grateful!
Regards Greg the Yeti
Its interesting that it is using the relatively new Windows function of irregular shaped windows!
But this of course means that a resolution will be hard to achieve, since Microsoft like making feedback about as difficult as swimming upstream in a raging torrent!
If I'm right, Orphalese doesn't currently support Vector Graphics formats?
If that one thing could be added it would boost the potential for really perfect graphics!
I've been using CorelDRAW for many years, for both serious and lighter weight stuff. If you know how it works, it is a very effective Desk Top Publishing tool. No need for the limitations of Microsoft Publisher or Serif's equivalent. CorelDRAW can do everything they can and more, giving you greater freedom of expression!
Vector Graphics can import pixel images, but the actual vector parts of the image are pure and simple. I.E. if the background is white - 255, 255, 255 - then it is all pure white - guaranteed!
PLUS the lines around areas that you define are as smooth as your "Node Editing Skills" allow them to be. (The fewest nodes give the smoothest edges! eg a circle or oval can be defined by just two "nodes")
If Orphalese could be made to handle the Vector EPS format, that wold be absolutely brilliant. Both CorelDRAW and Adobe Illustrator can export to that standard Vector format. (Also many of the 3D programs can export to EPS files as well!)
Other advantages for designing Orphalese Decks are that working with a Vector File allows the re-editing of the Deck much easier. In some situtations (like those Lottery Decks) it makes the creation of the Cards MUCH quicker!!
It looks to me very much like Dominatrix has used Vector Graphics for many Decks...
I'm not sure what would be required? Would it be just the inclusion of a single dll for conversion? (It might be a "pay for" option of course! Then it's just a question of it's value...)
Then again, it may be that Windows wouldn't accept or allow it.....
If you're able, I for one would be very grateful!
Regards Greg the Yeti
-
- Major Contributor
- Posts: 196
- Joined: Tue 01 May, 2007 3:11 pm
Re: Handling Transparency
Further to the above reply, I'm currently working on a graphic update to another Deck. Needless to say the update includes transparency. I followed the same process as the I Ching "Clear Advice" Decks (which had given very good results) but with this new deck it isn't working that way. This time not "jaggies" but whole white lines down one side or the other (varying from card to card). I've tried several ideas to get rid of them, but no luck so far.
I tried using an edge with the same colour (font type objects are normally used WITHOUT the edge) That didn't work...
I've tried using a different colour palette. I was using FOCOLTONE to get better colours, but note that the png format only uses 256 colours. No palette I've tried has worked.
I tried using black. That shouldn't have a colour palette problem! No joy!
Other than this rendering glitch, I've got it very good, so I really want to find out what is causing the problem!!
Regards Greg the Yeti
I tried using an edge with the same colour (font type objects are normally used WITHOUT the edge) That didn't work...
I've tried using a different colour palette. I was using FOCOLTONE to get better colours, but note that the png format only uses 256 colours. No palette I've tried has worked.
I tried using black. That shouldn't have a colour palette problem! No joy!
Other than this rendering glitch, I've got it very good, so I really want to find out what is causing the problem!!
Regards Greg the Yeti
-
- Major Contributor
- Posts: 196
- Joined: Tue 01 May, 2007 3:11 pm
Re: Handling Transparency
Success! - Hooray!
I came back from a walk with the dogs and decided to spend just a bit more time on a further test. Since this has been important to me, and perhaps someone else will have a similar problem, it's worth saying how I did it.
Three changes - which one "Did it" - well I really don't know... I've wasted so much time on this I really can't face doing the one by one tests which would be necessary.
1) I'm now using the RGB Palette. I've decided it has nicer colours anyway. This time I've gone for a dark green.
2) Since the problem is at the edges I decided to "beef up" the edges by changing them from "hairline" to 0.2mm. Because they're the same colour as the "fill" it makes no difference except increasing the "fat-ness" of the characters very slightly. That wasn't a problem.
3) On the Export Dialogue I DE-selected "Anti-Aliasing". Well the graphic I'm doing is horizontal and vertical straight lines - so it shouldn't need anti-aliasing anyway!
Result:- Nice clean crisp edges with none of the white "jaggies" or "ghost lines"! Excellent!
I will be sharing this new Deck soon, when I've finished doing the notes.
I will also apply the same ideas to the Lottery Decks with the same problem. (As soon as I have time.) That WILL be a test to see if the "anti-aliasing" is relevant!
Regards
Greg the Yeti
I came back from a walk with the dogs and decided to spend just a bit more time on a further test. Since this has been important to me, and perhaps someone else will have a similar problem, it's worth saying how I did it.
Three changes - which one "Did it" - well I really don't know... I've wasted so much time on this I really can't face doing the one by one tests which would be necessary.
1) I'm now using the RGB Palette. I've decided it has nicer colours anyway. This time I've gone for a dark green.
2) Since the problem is at the edges I decided to "beef up" the edges by changing them from "hairline" to 0.2mm. Because they're the same colour as the "fill" it makes no difference except increasing the "fat-ness" of the characters very slightly. That wasn't a problem.
3) On the Export Dialogue I DE-selected "Anti-Aliasing". Well the graphic I'm doing is horizontal and vertical straight lines - so it shouldn't need anti-aliasing anyway!
Result:- Nice clean crisp edges with none of the white "jaggies" or "ghost lines"! Excellent!
I will be sharing this new Deck soon, when I've finished doing the notes.
I will also apply the same ideas to the Lottery Decks with the same problem. (As soon as I have time.) That WILL be a test to see if the "anti-aliasing" is relevant!
Regards
Greg the Yeti
-
- Major Contributor
- Posts: 196
- Joined: Tue 01 May, 2007 3:11 pm
Re: Handling Transparency
RESULT!
I've just spent a little time updating the Lottery Decks (not finished but just a test run on the smallest one, the Euro Millions Stars). It is the "Anti-Aliasing" which is producing the problem! As the Lottery Decks were not straight lines my first go was just with the other two ideas from above (colour palette and edge thickness) but no joy, the problem was still there. So I did a run with the "Anti-Aliasing" turned off and lo and behold the nasty nasty white "Jaggies" dissappear! Wo Wo Wo! Hooray!
Now to cope with the "Black Jaggies" of the "Non-Anti-Aliased" numbers, I'm doing the main run with the numbers much bigger, then there is much less of a problem with the curves not being represented well. The files are so small anyway, being JUST a number and no other graphic, that an increase of the size of the file is not a problem.
Problem sorted!
I will have an update for all the Lottery Decks sometime this weekend...
Greg the Yeti
So remember folks:- Doing a Deck with Transparency? Using Vector Graphics? (CorelDRAW or Adobe Illustrator) - Turn off "Anti-Aliasing" when you export the cards!!
I've just spent a little time updating the Lottery Decks (not finished but just a test run on the smallest one, the Euro Millions Stars). It is the "Anti-Aliasing" which is producing the problem! As the Lottery Decks were not straight lines my first go was just with the other two ideas from above (colour palette and edge thickness) but no joy, the problem was still there. So I did a run with the "Anti-Aliasing" turned off and lo and behold the nasty nasty white "Jaggies" dissappear! Wo Wo Wo! Hooray!
Now to cope with the "Black Jaggies" of the "Non-Anti-Aliased" numbers, I'm doing the main run with the numbers much bigger, then there is much less of a problem with the curves not being represented well. The files are so small anyway, being JUST a number and no other graphic, that an increase of the size of the file is not a problem.
Problem sorted!
I will have an update for all the Lottery Decks sometime this weekend...
Greg the Yeti
So remember folks:- Doing a Deck with Transparency? Using Vector Graphics? (CorelDRAW or Adobe Illustrator) - Turn off "Anti-Aliasing" when you export the cards!!
-
- Major Contributor
- Posts: 196
- Joined: Tue 01 May, 2007 3:11 pm
Re: Handling Transparency
Having spent a little time with this new realisation, and updating Decks that required it. It's probably a good idea to put a brief explanation here of WHY "Anti-Aliasing" should cause problems with Transparency in Orphalese.
Lets imagine a very simple scenario. A round card of pure red on a pure white background. In Orphalese the white colour is selected as the transparent colour, because it is the background and occupies the top left pixel.
Now the "Evil Step-Mother" - Anti Aliasing - works by creating a zone inbetween the red circle and the white background. This is filled with pixels of varying tones, inbetween those two colours. These smudge the difference between any jagged edges that there would be between pixels of such great contrast. To the naked eye it usually makes the edges look better when displayed in a pixel format.
However - NOW you have, on the very edge of your round red card, some pixels which are NOT pure white but to the naked eye look quite like it.
When Orphalese removes all the pure white parts of the card it cannot remove those "Anti-Aliased" inbetween tones - because they're NOT pure white (or whatever other colour you've chosen for the transparent background).
Hence the nasty white "jaggies" as I called them.
It took me a good long while to work this out. I hope I have helped others to avoid the same problem.
Regards
Greg the Yeti
Lets imagine a very simple scenario. A round card of pure red on a pure white background. In Orphalese the white colour is selected as the transparent colour, because it is the background and occupies the top left pixel.
Now the "Evil Step-Mother" - Anti Aliasing - works by creating a zone inbetween the red circle and the white background. This is filled with pixels of varying tones, inbetween those two colours. These smudge the difference between any jagged edges that there would be between pixels of such great contrast. To the naked eye it usually makes the edges look better when displayed in a pixel format.
However - NOW you have, on the very edge of your round red card, some pixels which are NOT pure white but to the naked eye look quite like it.
When Orphalese removes all the pure white parts of the card it cannot remove those "Anti-Aliased" inbetween tones - because they're NOT pure white (or whatever other colour you've chosen for the transparent background).
Hence the nasty white "jaggies" as I called them.
It took me a good long while to work this out. I hope I have helped others to avoid the same problem.
Regards
Greg the Yeti
- Programmer
- Major Contributor
- Posts: 1725
- Joined: Sat 01 Jan, 2005 12:00 am
- Location: Spain
- Contact:
Re: Handling Transparency
Thanks for sharing the solution. I know that with PSP if you have antialiasing on it doesn't actually apply it until the moment you save the file, so that would be a particularly hard one to spot.