images icon indicating copy to clipboard operation
images copied to clipboard

Feature Request: Image Outline

Open garycarlyle opened this issue 6 years ago • 8 comments

Hi,

Just a feature request.

I think it would be really useful to have a coloured border. Would be a nice dynamic feature.

Great coding. :)

garycarlyle avatar May 23 '18 20:05 garycarlyle

@kleisauke : Maybe add something like &border=9 for 9 pixels of border, or &border=9,6 where 9 is top/bottom and 6 is left/right (like CSS).

I think it would just add to the image dimension? So &w=300 with &border=9 would be 318 pixels wide.

andrieslouw avatar May 26 '18 09:05 andrieslouw

This is a slippery slope, then you'll want a param &boxSizing=borderBox to ensure that w=300 with a border=9 stays 300 (sarcasm, don't worry.)

I think for most implementations of the API, CSS (web) or native-level borders (native) can be added by users; blurring, masking, etc., are great image serving CDN but I think borders might be going overboard. Next feature request will be shadows, otherwise. 👐

AnandChowdhary avatar Sep 29 '18 17:09 AnandChowdhary

That's true, let's give it some consideration. @garycarlyle : What would be the user case? Could you give an example of the result you'd like? For solid borders CSS seems to be more appropriate indeed.

andrieslouw avatar Sep 29 '18 18:09 andrieslouw

Taking another look, and I still agree with @AnandChowdhary on this issue. But if there are any compelling user cases, let us know, and we will reconsider this!

andrieslouw avatar Dec 13 '18 20:12 andrieslouw

Borders are very practical, particularly when dealing with screen shots, and they cannot be compared to shadows or other fancy things. I am really missing this feature.

A typical use case is posting screen shots on bulletin boards. If bulletin board background and screen shot background are in the same colour (very often both are white), you really want to add some border in order to separate posted picture from the rest of your post. And if you are a common user on a bulletin board, you probably cannot tweak with CSS.

Yes, there are alternatives. For example, one can make a table with a single cell just to have a border around that cell. But on some bulletin boards tables may be unavailable, on some others they may be borderless, and on some others simply cumbersome in use. Even if you cannot use tables, you can always download a screenshot, add a border in some image editor, and re-upload it to a hosting service. Yes, that would work, but I thought avoiding it is one of the goals of this project.

I've provided a use case. Hence, I suggest re-opening this issue.

Regarding what new parameters are needed, border colour is enough for my use case. Border thickness is not critical, but won't hurt either, especially that users will surely look for it in docs. My suggestion is to support only these two options. Obviously, default setting should be no border. If border thickness is set but border colour is not, then it should be black. If border colour is set but thickness is not, then it should be 2px. Doesn't really matter if w=300 parameter would mean picture width including border or excluding it, but it would be good to document this.

skalee avatar Jun 28 '20 13:06 skalee

Let's rediscuss this, as we now do have use cases.

andrieslouw avatar Jun 28 '20 13:06 andrieslouw

Sorry I have not logged into this account for ages. Was really cool of you to consider this. I think my use case was when using images on a website in a scenario that you would want border but would be more practical doing it with this rather than CSS. I cant remember why I would have liked that rather than CSS but I must of had a reason. :) Actually @skalee seems to have covered what I think was on my mind at the time.

garycarlyle avatar Jul 03 '20 07:07 garycarlyle

I'd be interested in this feature. I'm using weserv to generate circle GitHub avatars in a Github README, which is a case where I cannot use CSS (since Github strips it from <img> tags). It would be cute to include a light grey border around the circle mask, similar to how Github itself displays circle avatars.

Screenshot from 2022-04-24 13-02-47

https://github.com/mmcloughlin/avo#adopters

mmcloughlin avatar Apr 24 '22 20:04 mmcloughlin