# The Image Command

**URL:** <https://forum.choiceofgames.com/t/the-image-command/23648>\
**Category:** ChoiceScript Help\
**Created:** [January 30, 2017, 2:41pm UTC](https://forum.choiceofgames.com/t/the-image-command/23648 "2017-01-30T14:41:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lucid](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/lucid/32/39775_2.png) [@Lucid](https://forum.choiceofgames.com/u/Lucid)\
**Post date:** [January 30, 2017, 2:41pm UTC](https://forum.choiceofgames.com/t/the-image-command/23648/1 "2017-01-30T14:41:26Z")

</div>

I have some questions about the image command:

Does it resize it for the device? I have a rather large 2034x2048 image that I would like to display. In the past, I’ve made sure to convert it to .JPG This one is .PNG Is that a problem? Will it show actual size, which is way to big? Should I reduce it to another size, and if so, what size would be optimum?

I want to be sure that the options I choose work for publication, @dfabulich

Thanks!

---

<div class="post-metadata">

**Author:** ![Charles\_Parkes](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/charles_parkes/32/13554_2.png) [@Charles\_Parkes](https://forum.choiceofgames.com/u/Charles_Parkes)\
**Post date:** [January 30, 2017, 2:56pm UTC](https://forum.choiceofgames.com/t/the-image-command/23648/2 "2017-01-30T14:56:37Z")

</div>

Oddly I was just asking myself about this too. 😊 My testing suggests it does, but it would be nice if someone who knows more can confirm the resizing is foolproof on mobile devices

---

<div class="post-metadata">

**Author:** ![RETowers](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/retowers/32/21477_2.png) [@RETowers](https://forum.choiceofgames.com/u/RETowers)\
**Post date:** [January 30, 2017, 4:11pm UTC](https://forum.choiceofgames.com/t/the-image-command/23648/3 "2017-01-30T16:11:15Z")

</div>

Short answer: Yes.  
Long answer: It uses CSS: `max-width: 100%;`

Secondary Notes:

1. It’s preferable to use .png files for quality reasons.
2. The full command is `*image source alignment alt`  
a. Source is the image name (with file extension).  
b. Alignment is either `right`, `left`, `center` or `none`. (Optional unless alt is used.)  
c. Alt is the text that is instead displayed to visually impaired users using a screen reader. If and image is important to the story, you should use alt text so that it is understandable by more players.

---

<div class="post-metadata">

**Author:** ![Lucid](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/lucid/32/39775_2.png) [@Lucid](https://forum.choiceofgames.com/u/Lucid)\
**Post date:** [January 30, 2017, 4:18pm UTC](https://forum.choiceofgames.com/t/the-image-command/23648/4 "2017-01-30T16:18:45Z")

</div>

So, I can just \*image the file using .PNG format and not worry about the picture size because it will choose the “max size” which is essentially a decent screen size?

---

<div class="post-metadata">

**Author:** ![RETowers](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/retowers/32/21477_2.png) [@RETowers](https://forum.choiceofgames.com/u/RETowers)\
**Post date:** [January 30, 2017, 4:30pm UTC](https://forum.choiceofgames.com/t/the-image-command/23648/5 "2017-01-30T16:30:35Z")

</div>

Right. If the device is smaller than the width of the image, the image will be reduced to the device size (with a small margin on either side because of how things are set up).

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [January 30, 2017, 4:40pm UTC](https://forum.choiceofgames.com/t/the-image-command/23648/6 "2017-01-30T16:40:51Z")

</div>

@Sithwist (Or anyone else with wiki access.) Any chance that we can get this information added to the image page on the wiki please?

> **[Image](https://choicescriptdev.fandom.com/wiki/Image)**
>
> The\*image command is used to add images into the game. Images can be added wherever you want. The simple version is:\*image wolf.png You found a wolf!

---

<div class="post-metadata">

**Author:** ![Sithwist](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/sithwist/32/199235_2.png) [@Sithwist](https://forum.choiceofgames.com/u/Sithwist)\
**Post date:** [January 30, 2017, 5:53pm UTC](https://forum.choiceofgames.com/t/the-image-command/23648/7 "2017-01-30T17:53:14Z")

</div>

Two quick questions before I add this to the wiki.

- Which image file formats are supported?

- Does the image file really need to be in the _mygame_ folder? Is there a way for organization’s sake to put the images in an image folder and tell the command where to find the image? Something like `*image mygame/myimages/wolf.png`?

---

<div class="post-metadata">

**Author:** ![RETowers](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/retowers/32/21477_2.png) [@RETowers](https://forum.choiceofgames.com/u/RETowers)\
**Post date:** [January 30, 2017, 6:17pm UTC](https://forum.choiceofgames.com/t/the-image-command/23648/8 "2017-01-30T18:17:14Z")

</div>

Any image format is supported. (That is, the only thing it does is grab the file name with extension and try to display it. _How_ it’s displayed is determined by the device.) Unusual/non-standard inputs may lead to odd results (e.g. SVG files get squashed for some devices because no one appreciates dynamic images.)

I’d have to double check for all devices, but it should to work. (That is to say, off the top of my head, I don’t see why it _would_ break, but that doesn’t mean it _won’t_ break when packaged for publishing.)

---

<div class="post-metadata">

**Author:** ![Sithwist](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/sithwist/32/199235_2.png) [@Sithwist](https://forum.choiceofgames.com/u/Sithwist)\
**Post date:** [January 30, 2017, 7:05pm UTC](https://forum.choiceofgames.com/t/the-image-command/23648/9 "2017-01-30T19:05:02Z")

</div>

Ok, I edited the wiki page. Thanks, as always @FairyGodfeather for calling my attention to this. Should be more complete now. 🙂

> [@Sithwist](#):
>
> Does the image file really need to be in the mygame folder? Is there a way for organization’s sake to put the images in an image folder and tell the command where to find the image? Something like \*image mygame/myimages/wolf.png?

For anyone interested, I just tested this and yes, you can put the images in a “myimages” folder in the “mygame” folder. You just have to say `*image myimages/wolf.png`, and that works fine. That folder can be called whatever you like, of course.

---

<div class="post-metadata">

**Author:** ![jasonstevanhill](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/jasonstevanhill/32/198375_2.png) [@jasonstevanhill](https://forum.choiceofgames.com/u/jasonstevanhill)\
**Post date:** [January 30, 2017, 9:42pm UTC](https://forum.choiceofgames.com/t/the-image-command/23648/10 "2017-01-30T21:42:00Z")

</div>

FWIW in the past I’ve manually shrunk the images to a size where they would be appropriate for iPad. Anything larger than that is just wasting space.
