<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[M5Paper Image conversion]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I've forked the <a href="https://github.com/m5stack/M5Paper_FactoryTest" target="_blank" rel="noopener noreferrer nofollow ugc">Factory Test</a> and I'm trying to add new image resources. What source image format and tool (Linux compatible) should I use to generate C arrays like in <a href="https://github.com/m5stack/M5Paper_FactoryTest/blob/main/src/resources/ImageResource.h" target="_blank" rel="noopener noreferrer nofollow ugc">ImageResource.h</a>?</p>
<p dir="auto">Thanks</p>
]]></description><link>https://community.m5stack.com/topic/2674/m5paper-image-conversion</link><generator>RSS for Node</generator><lastBuildDate>Fri, 01 May 2026 01:07:34 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/2674.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 30 Dec 2020 23:45:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to M5Paper Image conversion on Thu, 31 Dec 2020 14:20:48 GMT]]></title><description><![CDATA[<p dir="auto">Thank you for your reply. Yes, I did stumble upon the <a href="https://github.com/m5stack/M5Stack/blob/master/tools/bin2code.py" target="_blank" rel="noopener noreferrer nofollow ugc">bin2code.py</a> script you mention. The issue is that it doesn't convert the image to raw pixel data (usable by <code>M5EPD_Driver::WriteFullGram4bpp</code>).</p>
<p dir="auto">After a bit more research, I found a preliminary command using ImageMagik to convert an image to raw pixel data for the M5EPD: <code>convert input.png -depth 4 -negate output.gray</code></p>
<p dir="auto">Then convert the raw data to C with <a href="https://github.com/m5stack/M5Stack/blob/master/tools/bin2code.py" target="_blank" rel="noopener noreferrer nofollow ugc">bin2code.py</a> : <code>./bin2code.py output.gray</code></p>
<p dir="auto">The result can then be appended to <a href="https://github.com/m5stack/M5Paper_FactoryTest/blob/main/src/resources/ImageResource.h" target="_blank" rel="noopener noreferrer nofollow ugc">ImageResource.h</a></p>
]]></description><link>https://community.m5stack.com/post/11476</link><guid isPermaLink="true">https://community.m5stack.com/post/11476</guid><dc:creator><![CDATA[Beetix]]></dc:creator><pubDate>Thu, 31 Dec 2020 14:20:48 GMT</pubDate></item><item><title><![CDATA[Reply to M5Paper Image conversion on Thu, 31 Dec 2020 03:11:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/beetix" aria-label="Profile: beetix">@<bdi>beetix</bdi></a> Hi ! feel free to look over our API: <a href="https://docs.m5stack.com/#/en/api/m5paper/epd_canvas" target="_blank" rel="noopener noreferrer nofollow ugc">epd_canvas</a><br />
if you want to use data to draw, you need to use <a href="https://github.com/m5stack/M5Stack/tree/master/tools" target="_blank" rel="noopener noreferrer nofollow ugc">this tool</a> to convert image to data.</p>
]]></description><link>https://community.m5stack.com/post/11462</link><guid isPermaLink="true">https://community.m5stack.com/post/11462</guid><dc:creator><![CDATA[Zontex]]></dc:creator><pubDate>Thu, 31 Dec 2020 03:11:09 GMT</pubDate></item></channel></rss>