Resize images vertically

Hi, this is my first post in this forum. I checked for possible duplicates and considered opening a new feature request for valid. Feel free to correct me if i have to do things differently :sweat_smile:

Use case or problem

For my use case i would like to resize an image by setting only a fixed height.
In my opinion, this is at least as important as resizing by width, because the vertical space of a document defines how much you can read until you have to scroll/turn pages.

An implementation of this feature would enable me to easily resize images with different aspect ratios to take up the same vertical space.

Proposed solution

My proposal for this would be:

[[image.png|x200]]

→ fixed height, width scales to retain the aspect ratio

Current workaround

Currently there are two resize options implemented (Docs: Embed files )

  • ![[image.png|100x100]] (fixed height and width)
  • ![[image.png|100]] (fixed width)

This Works also for linked images.

Both options are not to my satisfaction. The first one distorts the image if i do not calculate the scaled image by aspect ratios. The second one also requires calculation to do for every image embedded.

I would really like to hear your opinions on this topic :blush:

Annotations

It’s a bit unrelated but i would also like to have the option to center a resized image
horizontally

14 Likes

I’d like to resize an image by dragging a corner point, ideally. Similar to Adobe applications. In edit mode by clicking on an image perhaps it can show corner points for resizing and in preview mode it can hide them.

4 Likes

This is what we really need, instead of having to fiddle with a numerical value until we find the desired view size. Evernote does a great job of letting you non-destructively resize an image while preserving aspect ratio by just grabbing a corner using your mouse.

1 Like

Exactly the same ask and syntax suggested is intuitive. It is exactly he option I tried when checking if it could be done.

[[image.png|x200]]

1 Like

I agree that a syntax is needed to specify width or height, or maybe even both. The xW could be a special case of [[image.png|WxH]], so the default is backward-compatibility with |W, |xH specifies height only with aspect ratio kept, and |WxH lets aspect ratio be discarded.

Would love this feature as well :raised_hands:
I was honestly surprised when [[image.png|x200]] didn’t work—the syntax is very intuitive.

2 Likes

Currently, to set the scale of an embedded image, you can simply add a |width or |widthxheight| to rescale it, which is great. However, as far as I could tell, there’s no way of only scaling the height of the image to a certain length while preserving the aspect ratio.

I think height scaling is actually even more useful than width because often height is the problem since it isn’t limited like width. It can also cause text between images to spread too far apart and require a lot of scrolling. Currently, I have to rescale each image by eye to limit the height of images.

I propose the simple syntax of |xheight to assign only the height of the image to be rescaled. I imagine this wouldn’t be too hard to implement as a CSS snippet but it sounds intuitive enough to be a main feature.

4 Likes

Hey,

I do agree Obsidian needs some extra support for image manipulation, but until then maybe Image Converter plugin could help?

It can auto-apply |size to your dropped/pasted images, and even if image is still too big or too small, plugin gives you ability to easily resize any image by simply dragging edge of an image :raised_hands:

The plugin also gives you ability to auto-resize by HEIGHT/WIDTH/LONGEST SIDE etc. ,although it is destructive, and it will resize your original image file.

I’ve been using the plugin for a few weeks and it does indeed fulfill the deed. Thanks for the suggestion!

I still do hope this feature is implemented in vanilla Obsidian as it simply makes too much sense.