• he/him

I occasionally write long posts but you should assume I'm talking out of my ass until proved otherwise. I do like writing shit sometimes.  

 

50/50 chance of suit pictures end up here or on the Art Directory account. Good luck.

 

Be 18+ or be gone you kids act fuckin' weird.

 

pfp by wackyanimal


 

I tag all of my posts complaining about stuff #complaining, feel free to muffle that if you'd like a more positive cohost experience.

 


 
Art and suit stuff: @PlumPanAD

 


 
"DMs":
Feel free to message as long as you have something to talk about!


plumpan
@plumpan

Easier Image Downscaling

EDIT Feb 26: I MADE A TYPO! jpeg_extent should be jpeg:extent!!! Sorry! I found this at some point and didn't change it back up.

So on Cohost and other websites, you may not be allowed to upload images past a certain size (be that resolution or filesize), and require you to send a smaller image rather than the website downscaling for you. For most people, doing this either involves an "enough to be annoying" amount of work, or trusting your upload to some random website that says it'll downscale it for you.

The tool a lot of websites use to do this on their servers1 is called ImageMagick, and it's a tool we can use too. Normally that involves command line fuckery, but with the power of Windows Batch Files, we can turn it into an icon that you drag your images onto and receive a downscaled image. We also can control exactly what kind of downscaling we're doing, to meet file size or resolution targets.

The Short Version

Download ImageMagick for Windows
https://imagemagick.org/script/download.php

There's a bajillion links here but you only need the first one under the Windows section, as highlighted here. Install it normally, just make sure not to uncheck the box that says something about the path in the installer. It's checked by default so if you mash your way through, you'll be fine.

Open up a text editor (Notepad is fine) and paste in the following:

@echo off
%~d1
CD "%~p1"
FOR %%A in (%*) DO magick %%A -strip -define jpeg:extent=5000kb "small_%%~nA.jpg"

Save it as something with the .bat extension, such as smallify.bat. Then if you drag an image onto the batch file, you will receive a small version of it right next to, wherever you dragged the image from. It will be the same resolution, but now less than 5MB. It will also have metadata stripped from it, as you probably don't want that still attached.

You may need to press a button (any button) after the black window pops up, I don't know why this happens. But once the black box window closes, it's all done. This should be very fast unless you're converting a LOT of BIG files. And yes, you can drag multiple images onto this at once, so long as they're coming from the same folder.

If all you want is to make your images fit on cohost, that's it. If you want to know how to tweak this to other needs, or know how all of this works, there's more info below the break, including more examples if you don't care about how any of this works.

Also open for tagging suggestions for tags relevant to this kind of post


plumpan
@plumpan

callout post because the idiot that wrote this guide made a typo in all of the scripts and the filesize limit portion wasn't even working cancel this ass


You must log in to comment.

in reply to @plumpan's post:

True it's less customizable (I think you should at least be able to configure like a single compression level for all your resolutions) but the default seems to be good enough for most cases. I've never run an image through it and still had a file too big for what I'm doing or that looked noticeably bad for the resolution or anything.

The only big downside of this is you have to either resize + check file size + repeat if necessary or just slam the filesize down enough that you know it'll be good.

It's for sure a better option for some people that would rather have it in the context menu though, very good to know.

something I've idly thought about would be to make a userscript that embeds the whole ffmpeg in wasm so when you try to upload it can automatically downscale/downsample for you as needed

This is the next best thing, tho!

Thank you!

It's actually just accepting whatever is dragged on it as an argument. It's the same as going smallify.bat C:\Users\Plum\Pictures\BigImage.jpg in cmd. Just, way way easier.