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
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
Annotations
It’s a bit unrelated but i would also like to have the option to center a resized image
horizontally
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.
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.
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.
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.
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
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.
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.
I don’t know if this feature was added at some point, but after trial and error, I found if I use the following format it will lock the height and scale the aspect ratio respectively.
[[image.png|0x200]]
This works great when I’m placing portrait and landscape images side by side and don’t want the white space above the landscape image.