How to reduce the size of files?

One of my files is 703MB :mrgreen: . I know I have a lot of images inside the file.
My question is how can I find those images and change the type of images or just resize them with applications like ImageOptim
The files are RTF and I can’t access to the images like RTFD files by selecting “Show Package Contents” .
Thanks :wink:

Yeah, RTF has to embed the image directly into the file itself, which is why it isn’t a good idea to put a lot of them into on physical file (as represented by an item in the binder). RTFD is unfortunately not a standard format off of the Mac, so it’s not feasible to use that more scalable format internally.

Your best approach will be to combine two features:

  • The Edit ▸ Find ▸ Find by Formatting… tool (⌃⌥⌘F), which can be set to find images. This tool can optionally scour the entire project or just the current editor view.
  • Once you locate an image, right-click on it and select the option to save it to a file.

Now you can optimise the file on the disk, and drop it back into the editor—or you can use the Insert ▸ Image Linked to File… command to have a thumbnail shown in the editor, but the image itself will remain on the disk. Obviously you’ll need to plan a little to get that set up effectively, as you don’t usually want to be moving or renaming images once you link them up.

Using the file system will be best if you plan to periodically process the images in bulk, or would like to have the option of hot-swapping the master image folder to switch between sets (for example, black and white 300 DPI for conventional printing, compressed JPG for the Web/Ebook, etc.)

The other approach is the command right below that one, or more easily accomplished by setting the Behaviors: Dragging & Dropping: Link to images dragged from binder into editor. That accomplishes the same basic goal of keeping heavy graphics out of the file itself, but affords you the convenience of not having to keep track of the files on the disk. You would use the binder to organise them, and they can be edited from there with the Open in External Editor button in the footer bar.

That approach will not reduce the overall size of the “file” (if you mean that to refer to the whole project, which is really a special folder with potentially thousands of individual files within it), but it will distribute the weight into separate internal files within the project format. Of course if you optimise the images individually that should reduce the overall project size—but, importantly, the overall size of a project is of less concern than massive individual RTF files, for performance and other concerns. A large project will still be problematic for backing up and such, but the design of the format itself is design to scale into the gigabytes.

Lol my file is currently sitting at around 23 GIG. :smiling_imp:

Thanks AMBERV for the good information and explanation.
Actually the number of my images should be around 3,500 inside 1,050 files. It takes forever to find them one by one and fix them.

Do you work at CIA? :mrgreen:

Yikes! You might actually benefit a bit from setting up a compile setup specifically for exporting the images as files. Even if you just discard the document that is compiled for the files, it seems like that part of the process would be easier done all at once. The file types that compile to files are HTML, TXT (with some tweaks) and any of the Markdown-based types.

But to be a little clever with the idea, these compile settings could be tuned to produce a manifest of all exported images and where they should be returned to in the project—rather than compiling what we might think of as a traditional “document”. The attached compile Format is a simple demonstration of the concept. We use the TXT file type for its simplicity and overall control. We don’t really need HTML or a bunch of Markdown stuff—we just need a basic list of document titles and the image filenames found within them in the order they were discovered.

Example output:


Folder Name

First document with images

- name_of_file.jpg
- another_image.png

Second document

- and_so_on.png[/code]

Couple of hints:

  • Enable the Insert links back to Scrivener in each section, in the General Options tab of the compile overview screen. This will print URLs (which the compile format has been designed to pass through if they exist) that you can use to get back to the precise item in the binder that produced the image list. It will make your output a bit noisier, but a lot more convenient for working with.
  • Second hint: are these files not in the Draft folder and thus not eligible for compile by default? No problem, just select all of the top level folders in the binder you want to export this way, and then in the Contents tab in compile, set your compile group dropdown at the top to “Current Selection”, with Include subdocuments enabled.

Image (3.2 KB)

If I told you, I’d have to kill you…