Outline image, use colors from surroundings.

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
coolperez8
Posts: 27
Joined: 2016-03-11T07:27:11-07:00
Authentication code: 1151

Outline image, use colors from surroundings.

Post by coolperez8 »

So, I have a transparent image, and I want to outline it with it's own colors. I want the color of each pixel to be determined by the pixels next to it, with semi-transparent pixels having less effect than fully opaque pixels, and fully transparent pixels having no effect at all. Unfortunately, I can't find any image as an example for the effect.

ImageMagick Version:
Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-03-14 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib

OS: Ubuntu 16.04
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Outline image, use colors from surroundings.

Post by snibgo »

You could blur the image slightly, then composite the original over the blur.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Outline image, use colors from surroundings.

Post by fmw42 »

What is the purpose of this?

How do you define "the pixel next to it"? In what direction?

How thick an outline?

Without an example input and output, it is hard to know exactly what you want.
Post Reply