# Scaling an image to fit n pixels

**URL:** <https://forum.kirupa.com/t/scaling-an-image-to-fit-n-pixels/303245>\
**Category:** flash\
**Created:** [January 17, 2010, 3:23pm UTC](https://forum.kirupa.com/t/scaling-an-image-to-fit-n-pixels/303245 "2010-01-17T15:23:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmennenoh](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@dmennenoh](https://forum.kirupa.com/u/dmennenoh)\
**Post date:** [January 17, 2010, 3:23pm UTC](https://forum.kirupa.com/t/scaling-an-image-to-fit-n-pixels/303245/1 "2010-01-17T15:23:54Z")

</div>

I thought this was going to be easy, and hopefully for someone it is, but I’m having a tough time so thought I’d ask here…

I have an image - say 50 x 30 - 1500 pixels.

I need to scale it so that it keeps it proportion, and takes n pixels - say 20 for example.
