@@ -0,0 +1,1489 @@
+/*-%0A * #%25L%0A * SciJava polyglot kernel for Jupyter.%0A * %25%25%0A * Copyright (C) 2017 Hadrien Mary%0A * %25%25%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A * %0A *      http://www.apache.org/licenses/LICENSE-2.0%0A * %0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * #L%25%0A */%0A%0Apackage org.scijava.notebook.converter;%0A%0Aimport java.awt.image.BufferedImage;%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.IOException;%0Aimport java.util.Base64;%0A%0Aimport javax.imageio.ImageIO;%0A%0Aimport org.scijava.log.LogService;%0Aimport org.scijava.plugin.Parameter;%0A%0A/**%0A * Utility class for converters.%0A *%0A * @author Alison Walter%0A */%0Apublic class NotebookConverters %7B%0A%0A    @Parameter%0A    private static LogService log;%0A%0A    // TODO: Move this further upstream, possible in SciJava AWT?%0A    public static String toPNG(BufferedImage bi) %7B%0A        final ByteArrayOutputStream os = new ByteArrayOutputStream();%0A        try %7B%0A            ImageIO.write(bi, %22PNG%22, os);%0A        %7D catch (IOException ex) %7B%0A            log.error(ex);%0A        %7D%0A        return Base64.getEncoder().encodeToString(os.toByteArray());%0A    %7D%0A%7D%0A

Add utility class for NotebookConverters