<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>A4 blit Equivalent  </title>
		<link>http://www.allegro.cc/forums/view/618840</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 28 Jun 2023 20:44:18 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m working on an old unfinished A4 project. Converting it to A5.  I have a bitmap with a pink background.  When I put it on the screen it remains pink. So I&#39;m assuming the blit takes care of this.  Is there a blit equivalent for A5?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AceBlkwell)</author>
		<pubDate>Wed, 28 Jun 2023 19:40:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s the old &quot;magic pink&quot;, which was traditionally used as a mask colour.</p><p>In A5 you will need to call:</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/al_convert_mask_to_alpha"><span class="a">al_convert_mask_to_alpha</span></a><span class="k2">(</span>your_bitmap, <a href="http://www.allegro.cc/manual/al_map_rgb"><span class="a">al_map_rgb</span></a><span class="k2">(</span><span class="n">255</span>, <span class="n">0</span>, <span class="n">255</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

Where &quot;your_bitmap&quot; is the ALLEGRO_BITMAP* you want to create alpha for. That will turn the pink into an alpha channel.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dizzy Egg)</author>
		<pubDate>Wed, 28 Jun 2023 20:17:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks Dizzy.  Worked like a champ. Is there another way of making areas transparent, if &quot;pink&quot; is an old style approach?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AceBlkwell)</author>
		<pubDate>Wed, 28 Jun 2023 20:24:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If it is a file you&#39;re loading then do what I do.</p><p>Open it in a paint program that can manipulate the alpha channel. Set the alpha value of the pink pixels to 0 and save it. </p><p>May have to convert to another format, not sure. I use .png for all my bitmap files.</p><p>If not then yes, this is what you do:
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/al_convert_mask_to_alpha"><span class="a">al_convert_mask_to_alpha</span></a><span class="k2">(</span>your_bitmap, <a href="http://www.allegro.cc/manual/al_map_rgb"><span class="a">al_map_rgb</span></a><span class="k2">(</span><span class="n">255</span>, <span class="n">0</span>, <span class="n">255</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (DanielH)</author>
		<pubDate>Wed, 28 Jun 2023 20:31:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks Daniel.  Will that negate the need for converts or does it just change the pink to black?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AceBlkwell)</author>
		<pubDate>Wed, 28 Jun 2023 20:34:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Only sets the alpha channel to 0. Doesn&#39;t change the r, g or b.</p><p><span class="source-code"><a href="http://www.allegro.cc/manual/al_convert_mask_to_alpha"><span class="a">al_convert_mask_to_alpha</span></a></span><br />This function just converts every pixel that matches the color and sets the alpha channel to 0.</p><p>Either do it manually pre-load like I do or post-load with al_convert_mask_to_alpha.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (DanielH)</author>
		<pubDate>Wed, 28 Jun 2023 20:35:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Don&#39;t use transparent pink, except in your old sprites, and then as everyone said, convert the mask to alpha, but make it transparent black in your paint program, or transparent white, for blending purposes.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 28 Jun 2023 20:39:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Gotcha, so basically building the <br />al_convert_mask_to_alpha(your_bitmap, al_map_rgb(255, 0, 255));<br />into the picture.  Thanks. </p><p>Thanks Edgar.  I thought pink was the only color it would work with.   Didn&#39;t realize you could use other colors.   Thanks
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AceBlkwell)</author>
		<pubDate>Wed, 28 Jun 2023 20:39:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Just looked at source.</p><p>al_convert_mask_to_alpha converts any pixel that matches your color to RGBA (0,0,0,0)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (DanielH)</author>
		<pubDate>Wed, 28 Jun 2023 20:44:18 +0000</pubDate>
	</item>
</rss>
