Jump to content

Script that colors lone pixels with adjacent color?


lovkal

Recommended Posts

Hi. I'm working on a map file for a game which I'm trying to debug at the moment. The map file contains colors and each color represents a province in the game. However, whilst generating the provinces map, hundreds of little pesky, lone pixels remain everywhere, and the game tries to treat every one of those as a province. As of right now the only solution is to go by the coordinates given in the error log and remove them oneself. But like I said, there are hundreds of them, so such a minor thing takes forever. Is there a script for Paint.net that could mark a pixel automatically by typing in its coordinates and paint it over with an adjacent color?

 

Thanks in advance.

Edited by lovkal
Link to comment
Share on other sites

53 minutes ago, toe_head2001 said:

 

Thanks, but this doesn't work, I still have to look all pixels up one by one and use the plugin, and the plugin removes it, it doesn't color them with the adjacent color. (I'll change the title) Thanks anyway.

Link to comment
Share on other sites

1 hour ago, lovkal said:

Is there a script for Paint.net that could mark a pixel automatically by typing in its coordinates and paint it over with an adjacent color?

You want to manually type in hundreds of coordinates?

 

Why not just automatically color the lone pixels with the nearest color?

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

3 hours ago, toe_head2001 said:

You want to manually type in hundreds of coordinates?

 

Why not just automatically color the lone pixels with the nearest color?

 

I was just thinking that if the latter was not possible,  then the first would be better than nothing.

 

Link to comment
Share on other sites

I'll show the problem for simplicity's sake.

The red pixel is the problem here, and the entire map looks different, of course. I want every 'red' pixel (they're not all red) filled with its adjacent color, in this case brown or dark blue. 

paint.png

Link to comment
Share on other sites

Link to comment
Share on other sites

On 2017-04-16 at 6:53 AM, toe_head2001 said:

@lovkal

Here's a plugin for you. Let me know if it works well for you.

 

Effects -> Color -> Lone Color Remover

:RightArrowBlue:  LoneColorRemover.zip

 

Hi, thanks I'll try this!

EDIT: It seems to work rather well, thanks a lot!

Edited by lovkal
  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...