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

16 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.

5 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.

3 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.

5 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.

This feature is still badly neededā€¦ most plugins overdo it and cause more issues. Surely this isnā€™t difficult to implement?

1 Like

A height declaration isnā€™t necessary, therefore itā€™s missing. Just specify the right width to scale your hight accordingly.

If you want to cut your image to a different shape weā€™re taking about apples and oranges.
In this case, I wouldnā€™t be sure if technically possible, maybe yes.
I had the same idea time ago, but didnā€™t investigate further.

Respectfully, if it wasnā€™t necessary for some, this thread wouldnā€™t exist.

I already know that images scale the height with the width when the height isnā€™t specified. That isnā€™t relevant because I want the image to scale to a specified height. As is, to do this I need to break out a calculator or do trial and error - how is that not a problem for the user when a viable technical solution is more than possible?

The [image.png|width] syntax is not standard Markdown already; adding [image.png|autoxheight] or similar is not a very large ask and would help many people who use Obsidian professionally or simply want a standardized height in their notes that contain images.

Just because you arenā€™t sure of the technical possibility or usefulness does not mean it shouldnā€™t be implemented. Honestly, coming here to say ā€œno, I donā€™t need thatā€ is pretty weird.

Well, I wrote my comment months ago, feels like ages for me.
Are you interested to scale your images vertically and additionally, add them to a grid ? (Grid is optional)
If yes, check out my wiki, maybe itā€™s useful for you.