question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

3.x: Marbles should have a proper background

See original GitHub issue

The transparent ones look terrible with dark-themed IDEs or non-light background:

image

Only looks fine in Eclipse:

image

Write a program that goes through the images in https://github.com/ReactiveX/RxJava.wiki.git images/rx-operators, checks if the image has transparency, draw it onto a white background then save it as originalName.v3.png (because some of those are linked all around). Find the filename in the source code and replace them.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
tomislavhofmancommented, Apr 2, 2020
    private static void makeNonTransparentCopyOfImages(final List<File> files, final File outputFolder) {
        int index = 0;
        for (final File file : files) {
            if (!file.getName().contains(".png")) {
                continue;
            }
            try {
                BufferedImage image = ImageIO.read(file);
                int width = image.getWidth();
                int height = image.getHeight();
                if (image.getColorModel().hasAlpha()) {
                    BufferedImage background = new BufferedImage(width, height, image.getType());
                    Graphics2D g2 = background.createGraphics();
                    g2.setColor(Color.WHITE);
                    g2.fillRect(0, 0, width, height);
                    BufferedImage combined = new BufferedImage(width, height, image.getType());
                    Graphics g = combined.getGraphics();
                    g.drawImage(background, 0, 0, null);
                    g.drawImage(image, 0, 0, null);
                    ImageIO.write(combined, "PNG", new File(outputFolder, file.getName().replace(".png", ".v3.png")));
                } else {
                    System.out.println("Non transparent image: " + index + " - " + file.getName());
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            index++;
        }
    }
1reaction
akarnokdcommented, Apr 1, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Teach Your Kids How to Collect and Play Marbles - Persil
How to play marbles: Draw a circle 3 feet (90cm) wide on a pavement in chalk, or make one out of string if...
Read more >
Marble Product Photography Backdrop 3ft x 3ft, 3ft x 2ft ... - Etsy
Marble Product Photography Backdrop 3ft x 3ft, 3ft x 2ft, 2ft x 2ft, Clothing Headband Food Photography Background Vinyl Textured MRBL102.
Read more >
2 PCS Boards Photo Backdrop 2 Marbles Texture for Flat Lay ...
It is recommended that two photo backdrop board be used with right-angle buckles to build a simple photography scene quickly. One side has...
Read more >
Elgin Marbles - Wikipedia
The Elgin Marbles also known as the Parthenon Marbles are a collection of Classical Greek marble sculptures made under the supervision of the...
Read more >
Dropping Marbles With Millisecond Accuracy - Hackaday
MMX was good enough in all regards, including it's organic beauty and engineering. It had a soul. The new one will just be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found