-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.x: Marbles should have a proper background #6883
Comments
I'd like to do this if it's fine. |
@tomislavhofman Sure! |
While we're waiting for my internet to do the heavy lifting Here are some fun facts:
Here's a very bare and unsorted log of changes made to RxJava source code https://pastebin.com/qMvUFc1n
On a side note, if my 2nd attempt to push the wiki changes onto my fork fails. Would you be okay with me uploading just the updated images somewhere and you can update the wiki yourself? It's a difference between 100ish MB and 1GB. If that doesn't work for you I'll just try again. Once the wiki files are updated I'll submit the pull request for links updates. |
You won't be able to push to the wiki or create a PR for the wiki part. Can you upload the files into this issue via attachment(s)? |
Oh, and I thought I was being clever by researching and discovering how to make a PR to github wiki... I'll attach the files below |
Okay, I've uploaded all 749 images to a comment in this thread which I haven't posted yet... How should I approach posting them, I'm a bit confused here, it is a lot of images. edit: should I strip the image tag and post urls only? |
No no. Zip about Edit, looks like the limit is 10 MB only. |
How about you upload the code that does the image transformation? |
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++;
}
} |
Created PR (#6944) which should be safe to merge once images have been uploaded. |
The transparent ones look terrible with dark-themed IDEs or non-light background:
Only looks fine in Eclipse:
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 asoriginalName.v3.png
(because some of those are linked all around). Find the filename in the source code and replace them.The text was updated successfully, but these errors were encountered: