Code Monkey home page Code Monkey logo

dc6_png_enhance's Introduction

dc6 to png Enhance

A tool to convert from .dc6 (D2 images) to upsampled .png images

Requirements

Usage

Download the files from this repository and unzip

Open a terminal (shift + right click in your folder and select 'Open Powershell window here') then run python dc6_png_enhance.py

python dc6_png_enhance.py takes *.dc6 files in ./dc6/ and makes 4x ai upsampled pngs in ./png-hd/ (If there is an error about the python requests package, then in a CMD/powershell window do pip install requests)

Up sampling / super resolution is done with https://deepai.org/ 's API

The output upsampled .png feeds right into SpriteEdit and when converted to a .sprite can go into the D2R data folder data/hd/global/ui/items, panels, etc

Note: Trial API Key

dc6_png_enhance.py uses a trial API key from https://deepai.org.
If you need to convert more than 10 dc6 images then sign up to get an API key for free with https://deepai.org/.
Then enter your API key on line 15 of dc6_png_enhance.py after "api-key":".

Other Ideas

Image upsampling can be done with shaders from libretro, and other upsampling algorithms

for example https://docs.libretro.com/shader/scalefx/ ,and xbrz is popular https://docs.libretro.com/shader/xbrz/

Image Comparisons

Jewel: LoD, LoD enhanced, and D2R

  • LoD orig

  • LoD enhanced

  • d2r

Kinemil's Awl sword: LoD, LoD enhanced, and D2R

  • LoD orig

  • LoD enhanced

  • d2r

Credits and Tools

dc6_png_enhance's People

Contributors

pairofdocs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

cjmxp rulezkt

dc6_png_enhance's Issues

Add transparency: change rgb0,0,0 +/- to alpha channel for dc6-pngs

Using imagemagick

for png_name in pngs:
  # transparency
  convert .\png\png_name -fuzz 7.0% -transparent black .\png\tmp.png
  #alpha layer
  convert .\png\tmp.png -alpha extract .\png\tmp2.png
  # clean up alpha layer 
  convert .\png\tmp2.png -define connected-components:mean-color=true -define connected-components:area-threshold=200 -connected-components 4 .\png\tmp3.png
  # add blur to alpha layer boundary
  convert .\png\tmp3.png -blur 0x0.5 .\png\tmp3-b.png
  # compose orig image with alpha layer
  convert .\png\png_name .\png\tmp3-b.png -alpha off -compose copy_opacity -composite .\png\png_name + '-trsp-hd.png'
  # resize to proper D2R size
  convert .\png\png_name + '-trsp-hd.png' -resize 87.5% .\png_hd_resize\png_name + 'hd-resize.png'
  # sharpen the image
  convert .\png_hd_resize\png_name + 'hd-resize.png' -unsharp 0x1 .\png_hd_resize\png_name + 'hd-sharp.png'
  
  # Then convert pngs to .sprites using SpriteEdit

references:
https://legacy.imagemagick.org/discourse-server/viewtopic.php?t=33589

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.