<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: RLE compression</title>
	<atom:link href="http://www.prepressure.com/library/compression_algorithms/rle/feed" rel="self" type="application/rss+xml" />
	<link>http://www.prepressure.com</link>
	<description>Prepress, PDF, PostScript, Fonts and stuff...</description>
	<lastBuildDate>Thu, 11 Mar 2010 12:35:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Janette</title>
		<link>http://www.prepressure.com/library/compression_algorithms/rle#comment-43628</link>
		<dc:creator>Janette</dc:creator>
		<pubDate>Wed, 03 Mar 2010 02:36:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.prepressure.com/library/technology/compression_algorithms/rle#comment-43628</guid>
		<description>Anyone who has the source code in Java language? Thanks!</description>
		<content:encoded><![CDATA[<p>Anyone who has the source code in Java language? Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joe</title>
		<link>http://www.prepressure.com/library/compression_algorithms/rle#comment-40055</link>
		<dc:creator>joe</dc:creator>
		<pubDate>Wed, 27 Jan 2010 10:13:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.prepressure.com/library/technology/compression_algorithms/rle#comment-40055</guid>
		<description>tnx a lot to the contributor....
but i really need the sourcecode in VB6 language...
i hope somebody will upload here....</description>
		<content:encoded><![CDATA[<p>tnx a lot to the contributor&#8230;.<br />
but i really need the sourcecode in VB6 language&#8230;<br />
i hope somebody will upload here&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://www.prepressure.com/library/compression_algorithms/rle#comment-39678</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Sun, 17 Jan 2010 10:09:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.prepressure.com/library/technology/compression_algorithms/rle#comment-39678</guid>
		<description>One last note on the algorithms above, they only work with strings consisting of alpha values (letters) only. Add another controlcharacter to both methods (and don&#039;t forget to change the regular expression) to ensure nummeric values, and other ASCII values can also be found.</description>
		<content:encoded><![CDATA[<p>One last note on the algorithms above, they only work with strings consisting of alpha values (letters) only. Add another controlcharacter to both methods (and don&#8217;t forget to change the regular expression) to ensure nummeric values, and other ASCII values can also be found.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://www.prepressure.com/library/compression_algorithms/rle#comment-39661</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Sat, 16 Jan 2010 18:44:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.prepressure.com/library/technology/compression_algorithms/rle#comment-39661</guid>
		<description>I&#039;ll help you out a little then Laurens, here is some C# code that would help answering other programmers. However, this algorithm is very simple, they should be able to discover it by themselves based upon the text you provide above. Forgive me for the bad formatting...

NOTE: Some strings (and integers for containing sizes) have been provided as class variables and have been left out.

public string Compress(string stringToCompress)
        {
            string result = string.Empty;
            char previousLetter = &#039;&#039;;

            for (int i = 0; i  l == currentLetter);
                if (currentLetter != previousLetter)
                {
                    if ((int)count &gt; 1)
                        result += CONTROL_CHARACTER + count.ToString() + currentLetter;
                    else result += currentLetter;
                }
                previousLetter = currentLetter;
            }
            CompressedSizeInBytes = result.Length;
            return result;
        }

And a simple decompression:

public string DeCompress(string stringToDeCompress)
        {
            string result = string.Empty;

            string pattern = @&quot;(\d+)([A-Za-z])&quot;;

            Regex r = new Regex(pattern);
            Match m = r.Match(stringToDeCompress);

            int oldIndex = 0;
            while ( m.Success )
            {
                int newIndex = m.Index;         
                result += stringToDeCompress.Substring(oldIndex, (newIndex - oldIndex)-1);              
                oldIndex = newIndex + m.Length;

                for (int i = 0; i &lt; Int32.Parse(m.Groups[1].Value ); i++)
                    result += m.Groups[2].Value;
                m = m.NextMatch();
            }
            //Capture the last known chars (will only occur if there are characters at the end with only 1 occurence...
            if (oldIndex &lt; stringToDeCompress.Length)
                result += stringToDeCompress.Substring(oldIndex, stringToDeCompress.Length - oldIndex);
            return result;

        }

I hope this will help others. Note that it&#039;s not written for effiency, only for testing purposes. I haven&#039;t tested this code on images. 

Regards,

Robert.</description>
		<content:encoded><![CDATA[<p>I&#8217;ll help you out a little then Laurens, here is some C# code that would help answering other programmers. However, this algorithm is very simple, they should be able to discover it by themselves based upon the text you provide above. Forgive me for the bad formatting&#8230;</p>
<p>NOTE: Some strings (and integers for containing sizes) have been provided as class variables and have been left out.</p>
<p>public string Compress(string stringToCompress)<br />
        {<br />
            string result = string.Empty;<br />
            char previousLetter = &#8221;;</p>
<p>            for (int i = 0; i  l == currentLetter);<br />
                if (currentLetter != previousLetter)<br />
                {<br />
                    if ((int)count &gt; 1)<br />
                        result += CONTROL_CHARACTER + count.ToString() + currentLetter;<br />
                    else result += currentLetter;<br />
                }<br />
                previousLetter = currentLetter;<br />
            }<br />
            CompressedSizeInBytes = result.Length;<br />
            return result;<br />
        }</p>
<p>And a simple decompression:</p>
<p>public string DeCompress(string stringToDeCompress)<br />
        {<br />
            string result = string.Empty;</p>
<p>            string pattern = @&#8221;(\d+)([A-Za-z])&#8221;;</p>
<p>            Regex r = new Regex(pattern);<br />
            Match m = r.Match(stringToDeCompress);</p>
<p>            int oldIndex = 0;<br />
            while ( m.Success )<br />
            {<br />
                int newIndex = m.Index;<br />
                result += stringToDeCompress.Substring(oldIndex, (newIndex &#8211; oldIndex)-1);<br />
                oldIndex = newIndex + m.Length;</p>
<p>                for (int i = 0; i &lt; Int32.Parse(m.Groups[1].Value ); i++)<br />
                    result += m.Groups[2].Value;<br />
                m = m.NextMatch();<br />
            }<br />
            //Capture the last known chars (will only occur if there are characters at the end with only 1 occurence&#8230;<br />
            if (oldIndex &lt; stringToDeCompress.Length)<br />
                result += stringToDeCompress.Substring(oldIndex, stringToDeCompress.Length &#8211; oldIndex);<br />
            return result;</p>
<p>        }</p>
<p>I hope this will help others. Note that it&#039;s not written for effiency, only for testing purposes. I haven&#039;t tested this code on images. </p>
<p>Regards,</p>
<p>Robert.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurens</title>
		<link>http://www.prepressure.com/library/compression_algorithms/rle#comment-38466</link>
		<dc:creator>Laurens</dc:creator>
		<pubDate>Wed, 02 Dec 2009 19:22:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.prepressure.com/library/technology/compression_algorithms/rle#comment-38466</guid>
		<description>As already stated earlier in the comments: I am not a programmer and this site is not geared towards software development. I cannot help anyone asking for libraries, sample code,...</description>
		<content:encoded><![CDATA[<p>As already stated earlier in the comments: I am not a programmer and this site is not geared towards software development. I cannot help anyone asking for libraries, sample code,&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sudipta</title>
		<link>http://www.prepressure.com/library/compression_algorithms/rle#comment-38441</link>
		<dc:creator>Sudipta</dc:creator>
		<pubDate>Wed, 02 Dec 2009 06:54:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.prepressure.com/library/technology/compression_algorithms/rle#comment-38441</guid>
		<description>Can you send you send me the RLE image compression and decompression code in asp.net with c# or in matlab. Its very urgent. So, please help me.</description>
		<content:encoded><![CDATA[<p>Can you send you send me the RLE image compression and decompression code in asp.net with c# or in matlab. Its very urgent. So, please help me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rainie_vu</title>
		<link>http://www.prepressure.com/library/compression_algorithms/rle#comment-37630</link>
		<dc:creator>rainie_vu</dc:creator>
		<pubDate>Mon, 09 Nov 2009 12:13:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.prepressure.com/library/technology/compression_algorithms/rle#comment-37630</guid>
		<description>i find the code RLE compression for text in VB6.
but i don&#039;t find the code for BITMAP...
help me! please!</description>
		<content:encoded><![CDATA[<p>i find the code RLE compression for text in VB6.<br />
but i don&#8217;t find the code for BITMAP&#8230;<br />
help me! please!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurens</title>
		<link>http://www.prepressure.com/library/compression_algorithms/rle#comment-37016</link>
		<dc:creator>Laurens</dc:creator>
		<pubDate>Sat, 24 Oct 2009 08:03:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.prepressure.com/library/technology/compression_algorithms/rle#comment-37016</guid>
		<description>Regarding this and your other question about RLE: this site is geared towards prepress operators, not programmers. You&#039;ll have to look elsewhere for compression libraries, sample code, etc.</description>
		<content:encoded><![CDATA[<p>Regarding this and your other question about RLE: this site is geared towards prepress operators, not programmers. You&#8217;ll have to look elsewhere for compression libraries, sample code, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GNANI</title>
		<link>http://www.prepressure.com/library/compression_algorithms/rle#comment-36987</link>
		<dc:creator>GNANI</dc:creator>
		<pubDate>Fri, 23 Oct 2009 04:25:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.prepressure.com/library/technology/compression_algorithms/rle#comment-36987</guid>
		<description>can u send RLE algorithm C code</description>
		<content:encoded><![CDATA[<p>can u send RLE algorithm C code</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurens</title>
		<link>http://www.prepressure.com/library/compression_algorithms/rle#comment-36856</link>
		<dc:creator>Laurens</dc:creator>
		<pubDate>Sun, 18 Oct 2009 19:14:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.prepressure.com/library/technology/compression_algorithms/rle#comment-36856</guid>
		<description>They are both lossless so quality wise there is no difference. I have no idea which algorithm is the most efficient, in compression ratio or processing requirements. It might even be that there is no clear-cut answer to this and that it is different on a file-by-file basis. I have never done any comparisons so I cannot help you with this.</description>
		<content:encoded><![CDATA[<p>They are both lossless so quality wise there is no difference. I have no idea which algorithm is the most efficient, in compression ratio or processing requirements. It might even be that there is no clear-cut answer to this and that it is different on a file-by-file basis. I have never done any comparisons so I cannot help you with this.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.248 seconds -->
