# How to resize images

**URL:** <https://forum.getkirby.com/t/how-to-resize-images/15533>\
**Category:** Questions\
**Tags:** v3\
**Created:** [September 5, 2019, 10:34pm UTC](https://forum.getkirby.com/t/how-to-resize-images/15533 "2019-09-05T22:34:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdavid](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mdavid](https://forum.getkirby.com/u/mdavid)\
**Post date:** [September 5, 2019, 10:34pm UTC](https://forum.getkirby.com/t/how-to-resize-images/15533/1 "2019-09-05T22:34:54Z")

</div>

Hi have the following to display an image:

```auto
<?php if($image = $page->image('1-2-main.jpg')): ?>
           <img src="<?= $image->url() ?>" alt="">
     <?php endif ?>

```

I want to resize the image or create a thumbnail before displaying, how do I do that?

I tried

```auto
  <?php if($image = $page->image('1-1-main.jpg')): ?>
          echo <?= $image->resize(300) ?>
    <?php endif ?>

```

but that doesn’t change the size only the quality  
Thanks for any help

---

<div class="post-metadata">

**Author:** ![ODD\_CODE](https://avatars.discourse-cdn.com/v4/letter/o/858c86/32.png) [@ODD\_CODE](https://forum.getkirby.com/u/ODD_CODE)\
**Post date:** [September 6, 2019, 1:05am UTC](https://forum.getkirby.com/t/how-to-resize-images/15533/2 "2019-09-06T01:05:07Z")

</div>

I noticed you are missing a silicon

\<?= $image-\>resize(300); ?\>

You can try this \<?= $image-\>crop(100) ;?\>

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 6, 2019, 5:39am UTC](https://forum.getkirby.com/t/how-to-resize-images/15533/3 "2019-09-06T05:39:43Z")

</div>

@ODD_CODE The semicolon is not necessary in such one-liners.

@mdavid Check your stylesheet. If the image is set to 100% width and height, you won’t see a change in size on the frontend (it will only look blurry). And inspect the source code to see if the right image size is created.

---

<div class="post-metadata">

**Author:** ![mdavid](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mdavid](https://forum.getkirby.com/u/mdavid)\
**Post date:** [September 6, 2019, 7:01am UTC](https://forum.getkirby.com/t/how-to-resize-images/15533/4 "2019-09-06T07:01:54Z")

</div>

Thanks Sonja, I’ve got alot to learn - but getting there.

My long term memory ain’t wot it used to be, but I forget that, so its ok.

Have a great day

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 6, 2019, 7:15am UTC](https://forum.getkirby.com/t/how-to-resize-images/15533/5 "2019-09-06T07:15:19Z")

</div>

> [@mdavid](#):
>
> My long term memory ain’t wot it used to be, but I forget that, so its ok.

😂
