# Loading .png files dynamically?

**URL:** <https://forum.kirupa.com/t/loading-png-files-dynamically/11357>\
**Category:** Uncategorized\
**Created:** [January 16, 2003, 12:27am UTC](https://forum.kirupa.com/t/loading-png-files-dynamically/11357 "2003-01-16T00:27:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sillyrabbit](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sillyrabbit](https://forum.kirupa.com/u/sillyrabbit)\
**Post date:** [January 16, 2003, 12:27am UTC](https://forum.kirupa.com/t/loading-png-files-dynamically/11357/1 "2003-01-16T00:27:13Z")

</div>

Hi all,

First off is there a way to load the .png files like avatars?  
I know you can with .jpg but really need to retain the transparency of the .png also the imgs will be link to rather than on my local machine. I thought maybe running a php script to copy the img from [www.somewhere.com/img.png](http://www.somewhere.com/img.png) and save it to my folder so my swf could actually use them in the movie then.  
this is what I have so far any help would be appreciated.  
Thanks

\<?php

$filedest= “C:\Inetpub\wwwroot”  
$file = fopen (“[http://www.blahblah.com/img.png](http://www.blahblah.com/img.png)”, “r”);  
copy($file,$filedest);

?\>

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 16, 2003, 2:07am UTC](https://forum.kirupa.com/t/loading-png-files-dynamically/11357/2 "2003-01-16T02:07:27Z")

</div>

The only dynamically importable image file type is .jpg.

☹

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 16, 2003, 1:18pm UTC](https://forum.kirupa.com/t/loading-png-files-dynamically/11357/3 "2003-01-16T13:18:26Z")

</div>

Hello,

A conversion to jpg from png can be done with PHP. But, you lose the transparency.

The good news is that you could also dynamically pick up whatever background color you need and use that in the new image through PHP. A kind of “faux” transparency.

Hope that helps  
Karen

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 16, 2003, 8:14pm UTC](https://forum.kirupa.com/t/loading-png-files-dynamically/11357/4 "2003-01-16T20:14:24Z")

</div>

Convert png to swf, then load swf!
