<p>I don't think it's possible natively, yet (as of 2.3). However, the <a href="http://michaelrog.com/craft/imagesmith">ImageSmith</a> plugin addresses this need by providing a 'bulk transform' Twig filter which detects images in HTML, applies a specified transform, and rewrites the HTML to reference the transformed images.</p>

CC BY-SA 3.0
2014-12-03T05:09:15.077Z
2014-12-03T05:09:15.077Z
Michael Rog
<p>I just published a plugin called <a href="https://github.com/mmikkel/RetconHTML-Craft" rel="nofollow">Retcon HTML</a> – this includes a Twig filter for applying an image transform (named or inline) to all <code>&lt;img&gt;</code> tags in arbitrary HTML content (unfortunately only for local assets, for now).</p>

<p>See <a href="https://github.com/mmikkel/RetconHTML-Craft/wiki/Transform" rel="nofollow">this Wiki page</a> for specific instructions on how to apply image transforms with Retcon.</p>

CC BY-SA 3.0
2015-03-01T14:23:07.247Z
2015-03-01T14:23:07.247Z
Mats Mikkel Rummelhoff
<p>I have an image transform that is designed for images inserted into posts, and I'd like to make sure this is always applied to any image in a post. The problem I'm having is that for images inserted via Rich Text Fields, selecting a transform is optional, and the wrong transform may be selected.</p>

<p>Ideally I'd like to set a default transform so I can tell content editors that they can insert images directly into posts and don't need to do anything with the "Select image transform" option... is there any way of doing this, though? Any help or advice would be much appreciated!</p>

CC BY-SA 3.0
2014-12-03T07:39:05.360Z
Hey Nick, if you haven't already I'd recommend looking into a matrix field for adding the page content. You can set up a block type for text, and a block type for image, and would make for a much easier experience for any content editors.
Jamie Wade
CC BY-SA 3.0
2014-12-03T10:52:53.707Z
Thanks Jamie - excellent suggestion: as it happens I already am doing pretty much exactly that! :) However, the text block type is rich text, and although we do have separate Image blocks, the client wants to also be able to insert images inline in text blocks too. Tbh, with the extra degree of control over the image that you get when you insert them this way it does make sense that they want this. The image blocks aren't a problem - they seamlessly use the desired image transform - but I'm trying to also catch those images that get inserted via redactor in rich text fields.
Nick F
CC BY-SA 3.0
2014-12-03T11:33:35.180Z
Hmmm, that's a strange request! To be honest I can't see any advantage to inserting images inline with Redactor; as you say you get so much more control with inserting them through the image block. I'd recommend you put your foot down with the client and make them use matrix, but that's just me ;)
Jamie Wade
CC BY-SA 3.0
2014-12-03T11:36:11.827Z
Ah, no sorry - I meant you get more control when you insert them via redactor. Personally, I really like the "asset in an image block" approach, but redactor does allow easy resizing, inserting smaller images inline in text blocks, etc, so I can understand why they want to be able to do this.
Nick F
CC BY-SA 3.0
2014-12-03T11:41:06.420Z
Sure no worries. Obviously I'm not telling you how to build your site here, I'm just giving you an alternative. Matrix is built for exactly this kind of work, pretty much anything is possible within it. You can handle the image re-sizing with a simple dropdown field, whereby the transform for the image changes depending on which option is selected, and you can position the image using the Craft positioning field: http://buildwithcraft.com/docs/position-select-fields etc. Something to think about :)
Jamie Wade
CC BY-SA 3.0
2015-08-26T16:21:49.220Z
Vote for feature request please : http://feedback.buildwithcraft.com/forums/285221-feature-requests/suggestions/9088072-require-image-transform-when-selecting-an-image-in
migmaker
<assets><image-transforms><responsive-images>
Is there any way of setting / forcing a default image transform for images inserted via rich text blocks?
# Is there any way of setting / forcing a default image transform for images inserted via rich text blocks?

(Asked by: username_0 on 2014-12-02)

I have an image transform that is designed for images inserted into posts, and I'd like to make sure this is always applied to any image in a post. The problem I'm having is that for images inserted via Rich Text Fields, selecting a transform is optional, and the wrong transform may be selected.

Ideally I'd like to set a default transform so I can tell content editors that they can insert images directly into posts and don't need to do anything with the "Select image transform" option... is there any way of doing this, though? Any help or advice would be much appreciated!

**Tags:** assets, image-transforms, responsive-images

> **Comments:**
> **username_1**: Hey Nick, if you haven't already I'd recommend looking into a matrix field for adding the page content. You can set up a block type for text, and a block type for image, and would make for a much easier experience for any content editors.  
> **username_0**: Thanks Jamie - excellent suggestion: as it happens I already am doing pretty much exactly that! :) However, the text block type is rich text, and although we do have separate Image blocks, the client wants to also be able to insert images inline in text blocks too. Tbh, with the extra degree of control over the image that you get when you insert them this way it does make sense that they want this. The image blocks aren't a problem - they seamlessly use the desired image transform - but I'm trying to also catch those images that get inserted via redactor in rich text fields.  
> **username_1**: Hmmm, that's a strange request! To be honest I can't see any advantage to inserting images inline with Redactor; as you say you get so much more control with inserting them through the image block. I'd recommend you put your foot down with the client and make them use matrix, but that's just me ;)  
> **username_0**: Ah, no sorry - I meant you get more control when you insert them via redactor. Personally, I really like the "asset in an image block" approach, but redactor does allow easy resizing, inserting smaller images inline in text blocks, etc, so I can understand why they want to be able to do this.  
> **username_1**: Sure no worries. Obviously I'm not telling you how to build your site here, I'm just giving you an alternative. Matrix is built for exactly this kind of work, pretty much anything is possible within it. You can handle the image re-sizing with a simple dropdown field, whereby the transform for the image changes depending on which option is selected, and you can position the image using the Craft positioning field: http://buildwithcraft.com/docs/position-select-fields etc. Something to think about :)  
> **username_2**: Vote for feature request please : http://feedback.buildwithcraft.com/forums/285221-feature-requests/suggestions/9088072-require-image-transform-when-selecting-an-image-in  

---

## 2 answers

### Answer by username_3 on 2014-12-03. Score: 5

I don't think it's possible natively, yet (as of 2.3). However, the [ImageSmith](http://michaelrog.com/craft/imagesmith) plugin addresses this need by providing a 'bulk transform' Twig filter which detects images in HTML, applies a specified transform, and rewrites the HTML to reference the transformed images.


---

### Answer by username_4 on 2015-03-01. Score: 1

I just published a plugin called [Retcon HTML](https://github.com/mmikkel/RetconHTML-Craft) – this includes a Twig filter for applying an image transform (named or inline) to all `![]()` tags in arbitrary HTML content (unfortunately only for local assets, for now).

See [this Wiki page](https://github.com/mmikkel/RetconHTML-Craft/wiki/Transform) for specific instructions on how to apply image transforms with Retcon.


---

