<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>scaling &#8211; Set Side B</title>
	<atom:link href="https://setsideb.com/tag/scaling/feed/" rel="self" type="application/rss+xml" />
	<link>https://setsideb.com</link>
	<description>The Flipside of Gaming</description>
	<lastBuildDate>Tue, 13 Sep 2022 17:53:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://setsideb.com/wp-content/uploads/2022/04/cropped-mascot512-32x32.png</url>
	<title>scaling &#8211; Set Side B</title>
	<link>https://setsideb.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Let&#8217;s Learn About Pixel Scaling and Rotation</title>
		<link>https://setsideb.com/lets-learn-about-pixel-scaling-and-rotation/</link>
		
		<dc:creator><![CDATA[rodneylives]]></dc:creator>
		<pubDate>Mon, 26 Sep 2022 14:00:00 +0000</pubDate>
				<category><![CDATA[development]]></category>
		<category><![CDATA[retro]]></category>
		<category><![CDATA[emulation]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[nearestneighbor]]></category>
		<category><![CDATA[pixelart]]></category>
		<category><![CDATA[rotation]]></category>
		<category><![CDATA[rotsprite]]></category>
		<category><![CDATA[scaling]]></category>
		<guid isPermaLink="false">https://setsideb.com/?p=2179</guid>

					<description><![CDATA[When you start using emulators, it won&#8217;t be long before you&#8217;re brought up against the choice of which scalers to use, a bewildering collection of options with names like Nearest Neighbor, AdvMAME3x, and RotSprite. Resizing pixel images in an intelligent way is a difficult problem for many reasons. Most techniques intended for use on photographs &#8230; <a href="https://setsideb.com/lets-learn-about-pixel-scaling-and-rotation/" class="more-link">Continue reading<span class="screen-reader-text"> "Let&#8217;s Learn About Pixel Scaling and Rotation"</span></a>]]></description>
										<content:encoded><![CDATA[
<p>When you start using emulators, it won&#8217;t be long before you&#8217;re brought up against the choice of which scalers to use, a bewildering collection of options with names like <em>Nearest Neighbor</em>, <em>AdvMAME3x</em>, and <em>RotSprite</em>.</p>



<p>Resizing pixel images in an intelligent way is a difficult problem for many reasons. Most techniques intended for use on photographs won&#8217;t apply, since they&#8217;ll produce unacceptably blurry results when applied to extremely low resolution art. Pixel art is designed so that every dot matters, and adding new pixels carelessly can cause problems, such as Mario flipping us the bird in the right-hand image below:</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="576" height="288" src="https://setsideb.com/wp-content/uploads/2022/09/marioupscaleexample.png" alt="" class="wp-image-2180" srcset="https://setsideb.com/wp-content/uploads/2022/09/marioupscaleexample.png 576w, https://setsideb.com/wp-content/uploads/2022/09/marioupscaleexample-300x150.png 300w" sizes="(max-width: 576px) 85vw, 576px" /><figcaption>Mario vs MMarrioo:A possible result of bad upscaling.</figcaption></figure>



<p>Additionally, being done frequently in real-time emulation, scaling algorithms must be fast. Yet the fastest solution, called Nearest Neighbor, produces very blocky results, and also only really works well if images are scaled up to an integer multiple of the original in X and Y dimensions.</p>



<p>A good backgrounder of various issues is available from an old blog post <a href="https://www.datagenetics.com/blog/december32013/index.html">here</a>, but there&#8217;s been some interesting advancements in the field since then. <a href="https://info.sonicretro.org/RotSprite">RotSprite</a> is a good contemporary solution that also can rotate pixel art images well.</p>



<p>The problem of rotation is made simpler by a nifty trick that&#8217;s used by many image editors and libraries. <a href="https://gautamnagrawal.medium.com/rotating-image-by-any-angle-shear-transformation-using-only-numpy-d28d16eb5076">It turns out you can rotate an image by an arbitrary amount with three simple shear operations</a>. (If you don&#8217;t know what shearing is, it&#8217;s just tilting an image by some amount in a direction. It&#8217;s pretty awesome that this works since shearing is easy to do.)</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="293" src="https://setsideb.com/wp-content/uploads/2022/09/rotshear-1024x293.png" alt="" class="wp-image-2181" srcset="https://setsideb.com/wp-content/uploads/2022/09/rotshear-1024x293.png 1024w, https://setsideb.com/wp-content/uploads/2022/09/rotshear-300x86.png 300w, https://setsideb.com/wp-content/uploads/2022/09/rotshear-768x219.png 768w, https://setsideb.com/wp-content/uploads/2022/09/rotshear-1200x343.png 1200w, https://setsideb.com/wp-content/uploads/2022/09/rotshear.png 1400w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /><figcaption>Example image borrowed from the above linked page. I&#8217;m amazed this works.</figcaption></figure>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author"><div class="saboxplugin-tab"><div class="saboxplugin-gravatar"><img alt='rodneylives' src='https://secure.gravatar.com/avatar/cb688ada8b517e838b06bdbcddb8d1ea3dd56de2e66848938e8c6568002a4fa9?s=100&#038;d=mm&#038;r=g' srcset='https://secure.gravatar.com/avatar/cb688ada8b517e838b06bdbcddb8d1ea3dd56de2e66848938e8c6568002a4fa9?s=200&#038;d=mm&#038;r=g 2x' class='avatar avatar-100 photo' height='100' width='100' itemprop="image"/></div><div class="saboxplugin-authorname"><a href="https://setsideb.com/author/rodneylives/" class="vcard author" rel="author"><span class="fn">rodneylives</span></a></div><div class="saboxplugin-desc"><div itemprop="description"></div></div><div class="clearfix"></div><div class="saboxplugin-socials "><a title="Twitter" target="_self" href="https://twitter.com/rodneylives" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Instagram" target="_self" href="https://www.instagram.com/rodneysnotdead/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Html5" target="_self" href="https://www.metafilter.com/user/23306" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-html5" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="currentColor" d="M0 32l34.9 395.8L191.5 480l157.6-52.2L384 32H0zm308.2 127.9H124.4l4.1 49.4h175.6l-13.6 148.4-97.9 27v.3h-1.1l-98.7-27.3-6-75.8h47.7L138 320l53.5 14.5 53.7-14.5 6-62.2H84.3L71.5 112.2h241.1l-4.4 47.7z"></path></svg></span></a><a title="Mastodont" target="_self" href="https://cybre.space/@rodneylives" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-mastodont" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 417 512"><path fill="currentColor" d="M417.8 179.1c0-97.2-63.7-125.7-63.7-125.7-62.5-28.7-228.5-28.4-290.4 0 0 0-63.7 28.5-63.7 125.7 0 115.7-6.6 259.4 105.6 289.1 40.5 10.7 75.3 13 103.3 11.4 50.8-2.8 79.3-18.1 79.3-18.1l-1.7-36.9s-36.3 11.4-77.1 10.1c-40.4-1.4-83-4.4-89.6-54-.6-4.4-.9-9-.9-13.9 85.6 20.9 158.6 9.1 178.7 6.7 56.1-6.7 105-41.3 111.2-72.9 9.8-49.8 9-121.5 9-121.5zm-75.1 125.2h-46.6V190.1c0-49.7-64-51.6-64 6.9v62.5h-46.3V197c0-58.5-64-56.6-64-6.9v114.2H75.1c0-122.1-5.2-147.9 18.4-175 25.9-28.9 79.8-30.8 103.8 6.1l11.6 19.5 11.6-19.5c24.1-37.1 78.1-34.8 103.8-6.1 23.7 27.3 18.4 53 18.4 175z"></path></svg></span></a></div></div></div>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
